QFC: Client-validation but not on all buttons?

From: Date: Tue, 16 Dec 2003 16:39:54 +0000
Subject: QFC: Client-validation but not on all buttons?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-9595@lists.php.net to get a copy of this message
Hi! Yes - sorry - I forgot to put the QFC flag on my subject ... (and I also _all the time_ forget to use answer all instead of answer) Bertrand's way with JavaScript sounds nice ... but pushes me back to "how can I call a certain form without using "?_qf_formname_display=true". Or how do you handle that? I always have this problem - starting from the moment I load my frameset (because I use QFC to show lots of forms simultaneously which actually works fine) So - do I need a form loader script (consisting of a simple form that loads the real form) or is there another way? As Bertrand asks for an example (quite hard to cut it down to be understandable): I have a form which shows an address (from a DB). In there are Buttons: <new> <previous> <next> <delete> In all Actions besides <delete> the first thing I do is save the values to the DB. So I need validation for all the actions besides for <delete>. If the data is incorrect but the user wants to delete it anyway - it's fine but not in any other case. But for delete I still want to call the controller ... JavaScript or whatever is OK with me as the project only runs on a defined set of computers (with IE) - 1 at a time. Regards Daniel > -----Original Message----- > From: Bertrand Mansion [mailto:bmansion@mamasam.com] > Sent: Tuesday, December 16, 2003 4:09 PM > To: Daniel Kopp; pear-general@lists.php.net; Daniel Kopp; > pear-general@lists.php.net > Subject: Re: [PEAR] Client-validation but not on all buttons? > > > <pear@daniu.de> wrote : > > > Hi! > > > > How can I get JavaScript validation but not for all > Buttons. In php it > > is easy to get validation wherever (and only where) > necessary but how > > can I tell my JavaScript to ignore validation on "Cancel" > Buttons If I > > could overwrite the onSubmit-Action with JavaScript would > be fine for > > me - but I guess that is not possible, is it? Or can I add > some code > > to the JavaScript? > > 1. This is not the QuickForm mailing list so make sure you > tell when you are asking a question about QuickForm otherwise > one might think this is some HTML_Javascript question or whatever. > > 2. Assuming this is a QuickForm question, I would suggest you > make your cancel button a regular button (not a submit) and > use something like: > > $buttons[0] =& HTML_QuickForm::createElement('button', > 'cancel', 'Cancel', > > array('onclick'=>"javascript:location.href='http://www.bigboob > s.com';"));

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