Input Box Inserting Blanks or Empty Strings
January 7th, 2010Today I was doing a project and I got stumped on something so simple. I kept inserting a form with input text boxes and they kept inserting Empty Strings even though I was putting in data into the text box! I was getting so frustrated because I didn’t understand why there was no value. Well it turns out that if you don’t have value=”" it will not pick up a value. Very simple and kind of stupid…
Example:
<input name="nameHere" type="text" size="5" maxlength="5" value="" />
So the moral of the story is even if you are going to be inserting a blank value you have to have the value there. Wow I can’t believe I spent ten minutes on this problem! It happens to everyone