Hi
Just read your article on php and forms. Thanks for putting such a resource on the web. Just one quick question though. I don't want to have a check box initially checked but when I leave it blank it doesn't show up in the results. I am trying to produce a csv so this leaves me with one less coloum.
Is there a way around this
Thanks
David
Hi, David!
The nature of checkboxes is that they only show up if they're selected. You can either use a radio button instead, or you can stay with the checkbox but also include an empty hidden field of the same name. That way there's always a "value" with that name, even if the checkbox doesn't come through. Be careful, though, you'll then have to deal with multiple values for a
single field.
I hope that helps!
---- Nick
Technorati tags: php | forms | reader questions | html | web development |
Comments