averageman
averageman

Reputation: 923

HTML: text input is not being submitted

I have an HTML form with many fields, including a text field, that is,

<input name="my_field" type="text"></input>

Now, this text field is being changed by tons of JavaScript, jQuery and CSS code. The result of all this interaction is that when the form is submitted, this particular text field simply gets ignored (it is like that field was not there). I am not saying it get submitted with empy text, it simply doesn't appear in the list of fields submitted...

Because there are tons of code affecting this particular text field, I don't know what is causing this weird behavior. So I was wondering if someone could tell me what kind of HTML attribute (or JavaScript code, or jQuery code, or ...) could result in a text field being ignored.

At the end of all this interaction, I get the following HTML code (retrieved using the "Inspect Element" from Chrome):

<input id="id_my_field" maxlength="200" name="my_field" type="text" class="tt-query" autocomplete="off" spellcheck="false" dir="auto" style="position: relative; vertical-align: top; background-color: transparent;" data-original-title="" title=""></input>

Upvotes: 1

Views: 1890

Answers (2)

Andrey Shatilov
Andrey Shatilov

Reputation: 576

Add the name attribute, like this:

<input name="myField" type="text"></input>

Upvotes: 1

You should add a name attribute to the input:

<input type="text" name="myinput" />

Upvotes: 1

Related Questions