wood burning stoves*
The moose likes HTML, CSS and JavaScript and the fly likes Values from serialize are all null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Values from serialize are all null" Watch "Values from serialize are all null" New topic
Author

Values from serialize are all null

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Karthik Shiraly
Ranch Hand

Joined: Apr 04, 2009
Posts: 489
    
    5
serialize() requires form elements to have 'name' attributes, like this:

<input id="fName" name="fName" type="text" placeholder="first name"/>
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Values from serialize are all null
 
Similar Threads
How to rendar data from new window to old window through window.focus() ? Or any other way.
Database connection with struts
Jquery form validation
Can you post data from textfields to a URL without having a <form>
Resetting a Form