Quickform and dependent validation.

From: Date: Thu, 06 Feb 2003 12:48:50 +0000
Subject: Quickform and dependent validation.
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3910@lists.php.net to get a copy of this message
Hello, Can somebody give an example on how to validate several interdepence elements? Example: $form = new HTML_QuickForm(); $form->addElement('text', 'text1', 'enter number1'); $form->addElement('text', 'text2', 'enter number2'); $form->addRule('text1', 'must be numeric.', 'numeric'); $form->addRule('text2', 'must be numeric.', 'numeric'); [...] There should only be an error message, when no field is filled.
text1=xy, text2=null    => true
text1=null, text2=xy    => true
text1=null, text2=null => false I`ve tried to group this elements, but when i define a rule with 'required' every field has to be field. thanks, Tobias.

« previous php.pear.general (#3910) next »