Re: QuickForm problem with two forms in one page having an element with the same name

From: Date: Mon, 12 Apr 2004 08:07:33 +0000
Subject: Re: QuickForm problem with two forms in one page having an element with the same name
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-11780@lists.php.net to get a copy of this message
<goeran@zaengerlein.de> wrote : > Hello! > > I have a page with two QuickForm forms, each contains a hidden field called > "action" with either the string "new" or "edit". > > When the user submits the form, the script decides which of the form objects > validate methods to use, depending on the string received from the action > field of the form submitted. > I added a server side required validation for the text fields in each form. > The problem I have is the following: > When I submit one of the forms emtpy I get the page with the correct errors > telling me I have to fill in all fields, but the action fields in both forms > suddenly have the same value! > > I attached a very short demo script, anyone knows what I did wrong? ;) Yes, you didn't read the doc. You can use the last parameter of the constructor to make sure the form that was submitted is the one you want. Bertrand Mansion Mamasam

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