Skip to main content

Bug Tracker

Side navigation

#8928 closed bug (invalid)

Opened April 20, 2011 09:55PM UTC

Closed April 20, 2011 10:03PM UTC

Last modified August 03, 2011 09:55PM UTC

Form Serialize Not Including Elements Inside Tables

Reported by: hammer544833@hotmail.com Owned by:
Priority: undecided Milestone: 1.next
Component: ajax Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:
Description

Hello,

I'm using the jQuery library found at http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js and I just found a bug in the .serialize() function for forms.

One of the forms I have contains a table and that holds more input elements and when I tried to submit the form using the jQuery serialize function I get this:

oldPass=&newPass=&question=&answer=

I should be getting something like this:

oldPass=&newPass=&question=&answer=&username=YourTextHere&email=someone@anywhere.com&phone=1234567890

The following block is my entire form.

Please let me know if and when there is a fix for this bug.

<form id="userInfo" name="user" method="post" action="" title="Change any of these values to update your user information">

<input type="hidden" value="" name="oldPass" />

<input type="hidden" value="" name="newPass" />

<input type="hidden" value="" name="question" />

<input type="hidden" value="" name="answer" />

<table>

<tr>

<td>

<label for='username'>Username:</label>

</td>

<td>

<input id='username' type="text" value="" />

</td>

</tr>

<tr>

<td>

<label for='email'>Email Address:</label>

</td>

<td>

<input id="email" type="email" value="" />

</td>

</tr>

<tr>

<td>

<label for="phone">Phone Number:</label>

</td>

<td>

<input id="phone" type="text" value="" />

</td>

</tr>

</table>

<div style="text-align:center;">

<span id="user" style="color:red;font-weight:bold"></span><br />

<input type="submit" value="Submit" />

<input type="reset" value="Reset" />

</div>

</form>

Attachments (0)
Change History (4)

Changed April 20, 2011 10:03PM UTC by rwaldron comment:1

resolution: → invalid
status: newclosed

According to the API, you're doing it wrong. http://api.jquery.com/serialize/

serialize() requires a name attribute

Changed April 20, 2011 10:03PM UTC by rwaldron comment:2

component: unfiledajax

Changed April 20, 2011 10:15PM UTC by hammer544833@hotmail.com comment:3

The initial results were from the following command

alert($("form#userInfo").serialize());

Changed August 03, 2011 09:55PM UTC by anonymous comment:4

Even when there are name attributes, it does not work with a table in form in IE.