Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Values from serialize are all null

 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, So I am getting further. I can actually see my popup trying to post to my backend controller. However, all the values are null. I am trying to use serialize() since that seems to be what everyone online is saying to use.

Here is my support.jsp page



And here is the js file



At var formValues = $("#registration").serialize();
alert(formValues);

I get blank, even though I have filled in the input fields on the UI.

My only guess is that I am not using submit, but have an link instead that calls the click function. I hope I don't have to have a <input type="submit" ..> to get that to work. Then have to disable the submit or return false;

Thanks

Mark
 
Karthik Shiraly
Bartender
Posts: 1208
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
serialize() requires form elements to have 'name' attributes, like this:

<input id="fName" name="fName" type="text" placeholder="first name"/>
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Karthik Shiraly wrote:serialize() requires form elements to have 'name' attributes, like this:

<input id="fName" name="fName" type="text" placeholder="first name"/>


Thank you very much, that is exactly what I needed.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic