jquery - JSON values are null -


I'm sure it's really simple ...

I have a code. .

  & lt; Script & gt; Function postUser () {var user = $ ('span'). Serialize (); $ .post ('User Management / Setup', Users); } & Lt; / Script & gt; & Lt; Period & gt; Username: & lt; Input type = "text" name = "username" & gt; & Lt; Br / & gt; First name: & lt; Input type = "text" name = "first name" /> gt; & Lt; Br / & gt; Last name: & lt; Input type = "text" name = "last name" /> gt; & Lt; Br / & gt; Password: & lt; Input type = "text" name = "password" / & gt; & Lt; Br / & gt; & Lt; Button onclick = "postUser ()" & gt; Submit & lt; / Button & gt; & Lt; / Span & gt;   

Nothing was posted (as in the post really is empty according to the firebug).

How can I post this form? I want to use jQuery so that I can improve it by putting it on better HTML. My controller is expecting a JSON object that is just my user unit, as well as with an integer field for "access".

I am using SpringMVC for the controller.

Thanks,

Try it out:

  Var user = $ ('form'). Sort ();   

then:

  & lt; Form action = "#" method = "post" & gt; Username: & lt; Input type = "text" name = "username" & gt; & Lt; Br / & gt; First name: & lt; Input type = "text" name = "first name" /> gt; & Lt; Br / & gt; Last name: & lt; Input type = "text" name = "last name" /> gt; & Lt; Br / & gt; Password: & lt; Input type = "text" name = "password" / & gt; & Lt; Br / & gt; & Lt; Button type = "button" onclick = "postUser ()" & gt; Submit & lt; / Button & gt; & Lt; / Form & gt;    

Comments