cvs: pear /HTML_QuickForm QuickForm.php

From: Date: Thu, 14 Jul 2005 21:07:37 +0000
Subject: cvs: pear /HTML_QuickForm QuickForm.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-33047@lists.php.net to get a copy of this message
avb Thu Jul 14 17:07:37 2005 EDT Modified files: /pear/HTML_QuickForm QuickForm.php Log: Prevent javascript errors with frozen forms (see bug #4832) http://cvs.php.net/diff.php/pear/HTML_QuickForm/QuickForm.php?r1=1.156&r2=1.157&ty=u Index: pear/HTML_QuickForm/QuickForm.php diff -u pear/HTML_QuickForm/QuickForm.php:1.156 pear/HTML_QuickForm/QuickForm.php:1.157 --- pear/HTML_QuickForm/QuickForm.php:1.156 Thu Jul 14 16:32:05 2005 +++ pear/HTML_QuickForm/QuickForm.php Thu Jul 14 17:07:37 2005 @@ -17,7 +17,7 @@ // | Bertrand Mansion <bmansion@mamasam.com> | // +----------------------------------------------------------------------+ // -// $Id: QuickForm.php,v 1.156 2005/07/14 20:32:05 avb Exp $ +// $Id: QuickForm.php,v 1.157 2005/07/14 21:07:37 avb Exp $ require_once('PEAR.php'); require_once('HTML/Common.php'); @@ -1021,7 +1021,7 @@ $this->_rules[$element] = array(); } if ($validation == 'client') { - $this->updateAttributes(array('onsubmit'=>'return validate_'.$this->_attributes['id'] . '(this);')); + $this->updateAttributes(array('onsubmit' => 'try { var myValidator = validate_' . $this->_attributes['id'] . '; } catch(e) { return true; } return myValidator(this);')); } $this->_rules[$element][] = array( 'type' => $type, @@ -1092,7 +1092,7 @@ $required++; } if ('client' == $validation) { - $this->updateAttributes(array('onsubmit'=>'return validate_'.$this->_attributes['id'] . '(this);')); + $this->updateAttributes(array('onsubmit' => 'try { var myValidator = validate_' . $this->_attributes['id'] . '; } catch(e) { return true; } return myValidator(this);')); } } } @@ -1126,7 +1126,7 @@ $this->_required[] = $group; } if ($validation == 'client') { - $this->updateAttributes(array('onsubmit'=>'return validate_'.$this->_attributes['id'] . '(this);')); + $this->updateAttributes(array('onsubmit' => 'try { var myValidator = validate_' . $this->_attributes['id'] . '; } catch(e) { return true; } return myValidator(this);')); } } } // end func addGroupRule

« previous php.pear.cvs (#33047) next »