jquery convert serialized form inputs to xml string

Posted by user590586 on Stack Overflow See other posts from Stack Overflow or by user590586
Published on 2011-02-06T14:16:44Z Indexed on 2011/02/06 15:25 UTC
Read the original article Hit count: 149

Filed under:

Hi ,

I'm trying to get all my form inputs and then create with them an xml string containing there values in order to send them via ajax.

i want this :

<form id="formtest">
 <input type="text" name="test1" id="test1"/>
 <input type="text" name="test2" id="test2"/>
 <input type="text" name="test3" id="test3"/>
 <input type="text" name="test4" id="test4"/>
 <input type="text" name="test5" id="test5"/>           
</form>

to become:

<formtest>
  <test1></test1>
  <test2></test2>
  <test3></test3>
  <test4></test4>
  <test5></test5>
</formtest>

How can this be done?

Thank's In Advance.

© Stack Overflow or respective owner

Related posts about jQuery