HTML_Quickform rule fails!!!!
I am using alphanumeric rule in HTML_Quickform but users could still send numeric values only.
Here is the code:
PHP 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:', '@');
$txttotalmail_id_domain->setvalue('totalmail.co.za');
$txttotalmail_id_domain->freeze();
$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
$form1->addGroupRule('txttotalmail_id_value', array($txttotalmail_rules,));
It shows the error message when no data is typed but accepts any kind of data eventually.
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?????