Results 1 to 3 of 3
Thread: HTML_Quickform rule fails!!!!
Aug 7, 2007, 07:25 #1
- Join Date
- Oct 2004
- 0 Post(s)
- 0 Thread(s)
HTML_Quickform rule fails!!!!
I am using alphanumeric rule in HTML_Quickform but users could still send numeric values only.
Here is the code:
$txttotalmail_id = $form1->createElement('text', 'txttotalmailid', '', array( 'size' => 25, 'maxlength' => 30));
$txttotalmail_id_domain = $form1->createElement('text', 'txttotalmaildomainid', '', array( 'size' => 25, 'maxlength' => 15, 'value'=> 'totalmail.co.za', 'onFocus' => 'this.blur()'));
$form1->addGroup(array($txttotalmail_id, $txttotalmail_id_domain), 'txttotalmail_id_value', 'Totalmail ID:', '@');
$txttotalmailid_rule_1 = array('ID is not valid', 'required');
$txttotalmailid_rule_2 = array('ID is not valid', 'nopunctuation');
$txttotalmailid_rule_3 = array('ID is not valid', 'minlength', 3);
$txttotalmailid_rule_4 = array('ID is not valid', 'alphanumeric');
//merge the rules or re-encapsulate in array
$txttotalmail_rules = array($txttotalmailid_rule_1, $txttotalmailid_rule_2, $txttotalmailid_rule_3, $txttotalmailid_rule_4);
//apply the rules
Likewise, I discovered that some functions don't work again or deprecated in HTML_Quickform. This "$txttotalmail_id_domain->freeze();" doesn't work also though i worked on older version of Apache or PHP engine(one of my Local Machines).
What could be wrong?????Success is achieved and maintained by those who keep trying.