Sunday, August 14, 2011
Missing 0 in HTML Form with PHP and JavaScript?
I am developing a web form using HTML form fields. The form is filled in over several pages, so I post the information from each page to the next page. On each page, I maintain a list of hidden form fields that contain all of the form fields for all of the pages (minus the ones that are on that page) where I use PHP to fill in the the hidden fields with the post data from the previous page. This allows the user to move back and forth between pages and have all of the data filled in at that point to reappear for editing. The problem I am having is that when a user types a "0" into one of the form fields, it doesn't carry over. It's as if either JavaScript or PHP think that a value of zero is null. I ran into this problem with the drop down boxes. If one of the items in the list had a zero, it would take it to be null and the value wouldn't carry over. The simple correction for that was to eliminate all list items with a value of zero. Well, I cannot stop the user from typing in a zero, and actually it is very necessary. Any ideas?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment