1

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>

2 Answers 2

1

You should add a name attribute to the input:

<input type="text" name="myinput" />
Sign up to request clarification or add additional context in comments.

1 Comment

Sorry. I forgot to mention that the name attribute is being set. Question edited.
1

Add the name attribute, like this:

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

3 Comments

Sorry. I forgot to mention that the name attribute is being set. Question edited.
I just posted something that might help.
Firebag use to view the post data sent on server

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.