HTML_QuickForm and advcheckbox, why JavaScript?
| From: | Christoph Schiessl | Date: | Thu, 23 Aug 2007 07:49:32 +0000 |
| Subject: | HTML_QuickForm and advcheckbox, why JavaScript? | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-47825@lists.php.net to get a copy of this message | ||
Hi!
Recently I was wondering why the advcheckbox element in QuickForm is relying on JavaScript. From the documentation:
HTML class for an advanced checkbox type field. Basically this fixes a problem that HTML has had where checkboxes can only pass a single value (the value of the checkbox when checked). A value for when the checkbox is not checked cannot be passed, and furthermore the checkbox variable doesn't even exist if the checkbox was submitted unchecked. It works by creating a hidden field with the passed-in name and creating the checkbox with no name, but with a javascript onclick which sets the value of the hidden field. Wouldn't it be easy to do exactly that on the server-side without out relying on a JavaScript enabled client?Best regards Christoph Schiessl PS: I'm using QuickForm in all my PHP projects and I have to say, it's really a great piece of software. So, thank you all for your effort in developing QuickForm and PEAR in general.