Forum Moderators: open

Message Too Old, No Replies

Help With Form Submission

control

         

mongoloid001

3:42 pm on Feb 23, 2004 (gmt 0)

10+ Year Member



Hi, I am a bit of confused with the concept of successful control and unsuccessful control in form submission. In w3 recommendation:

---------------
If a control doesn't have a current value when the form is submitted, user agents are not required to treat it as a successful control.
---------------

Also from my own experience, browsers do not submit empty fileds, i.e., unsuccessful control. But the application I am working with is doing the exact opposite(which is driving me nuts because I don't want my empty fields get submitted). And I am clueless right now. Anyone has any idea on how this could be possible? Here is the form:

<form name="ManageForm" method="post" action="/Manage.do;jsessionid=26CB107EF9925FB8EEDD4F1223FD89D9" enctype="multipart/form-data">
<input type="text" name="hInput" value="">
<input type="submit" value="submit" >
<input type="text" name="hOutput" value="">
</form>

Thanks in Advance!

grahamstewart

3:48 pm on Feb 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It don't really matter because you'll still have to make sure your form handling script can handle empty or strange entries for the controls.

Remember that a malicious user could pretty much submit anything they like with a form including empty fields, very large fields and strange characters.

mongoloid001

4:21 pm on Feb 23, 2004 (gmt 0)

10+ Year Member



Thanks. Yes, I know that. My problem is I cannot get to my form handling action because the validation fails for all the empty fields. I am using a third party validation framework(which I have had success before), and all the empty fields should be ignored....

But when I take a look in the request header, I can see all these empty fields being submitted. What's going on?

DrDoc

4:49 pm on Feb 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Most browsers submit empty fields...
Remember, it's not an empty input -- it's an input with the value "".

mongoloid001

5:58 pm on Feb 23, 2004 (gmt 0)

10+ Year Member



i have to disagree with you on that one. An input with value="" is considered empty string. Otherwise what's an empty string?

DrDoc

6:32 pm on Feb 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Empty string, yes... but that doesn't mean the field is empty. The field still contains the string, even though the string may be empty. There's no way of defining "null" for regular text fields (which is why browsers include them in the submitted form data). Now checkboxes, on the other hand, are either checked or not (=null)... which is why an unchecked checkbox doesn't get included.

...if you see what I'm getting at?