This is a discussion on Hide form submit button value within the PHP Language forums, part of the PHP Programming Forums category; Greetings, Chetan Pandya. In reply to Your message dated Wednesday, June 11, 2008, 02:15:44, >>>>...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Greetings, Chetan Pandya.
In reply to Your message dated Wednesday, June 11, 2008, 02:15:44, >>>>Note: unchecked checkboxes does not provide any data to server too. If you >>>>want to see them even if they are not checked, that's work for some kind >>>>of javascript in form processing. >> >>> Nope, JS is unreliable. You should use some better server-side form >>> processing to keep track of the initial checkbox value. If it's then >>> missing in the form submission, you can safely assume it was unchecked. >> >> Interesting offer... can't remember if I have tested such possibility... >> Ok, tested... it does not change the core issue. If you have some value >> assigned to checkbox, it will be sent to script instead of default "on" text. >> And that's all. I will not rely on that value in any of my project, just in >> case some lame browser will eventually send me "on" instead of that value. > Quite the opposite. It would appear that "on" is a default value being used if > you fail to provide one. If you don't want to rely on the values, perhaps the > simpler solution is to just check if the corresponding "name" is set. Note, > however, that checkboxes are similar to radio boxes and normally all radio > boxes in a group are given the same name and different values. We may have long discussion about relations between different web controls :) But i'd better stop it with a simple statement: Use what you think suits your needs better, but don't forget to carefully check values passed to you as like they contains some smelly crap. -- Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru> |