an input text element posts an empty string
I am wondering about a form tag which has the name “form1” and no assigned value.
by null I mean “not set”.
an input text element posts an empty string I am wondering about a form
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It posts an empty string (if that’s relevant to the input type). You can’t post a null because HTTP doesn’t have a native representation for the concept. (You can post, for example, a JSON string that decodes to a null, but that’s not the same thing.)
It’s possible that what you meant by “posting a null” is posting a set of form key:value pairs that has no key corresponding to the element in question. That’s what happens if you disable the element; if a text input, for example, is not disabled and has no value set, a key:value pair gets posted for it where the value is an empty string.