kappa has asked for the wisdom of the Perl Monks concerning the following question:
Good day to all!
There is an old HTML problem -- browsers do not send anything about unchecked checkboxes when submitting forms. How do you people usually use HTML::FillInForm to uncheck checkboxes which default to checked state?
Example:
Suppose, I want to refill this form using HTML::FillInForm after user submitted the form. She unchecked the checkbox. To repeat unchecking the checkbox I need to pass c => 0 to fill() but browsers in their eternal wisdom do not send me anything about the checkbox so my code now needs knowledge that there is such a control on the form.<form> <input type=checkbox name=c checked> </form>
I've faced the issue ten or more times and always used some hacks with enumerating all checkboxes in a list and then generating pairs to pass to fill(). Are there cleaner ways?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML::FillInForm vs. checked by default checkboxes
by bradcathey (Prior) on Feb 18, 2009 at 19:32 UTC | |
by kappa (Chaplain) on Feb 19, 2009 at 13:40 UTC |