JQuery serialize function with an empty input field that has a title attribute

363 views Asked by At

I have the following form input field:

<input type="text" value="" title="Enter item description" name="description">

When I call JQuery's serialize function on the containing form, it gives me the following:

description=Enter+item+description

Does anyone know why serialize() takes the title as a value for the description field? How can I get around this? I want the result to be:

description= (i.e. no value)
1

There are 1 answers

1
Victor On BEST ANSWER

Thats not the behavior of serialize(). I think you may have another plugin or code that is loading the value of the title tag into the value of the field. I know there are many plugins that use the value to create ghost text or to do a mask on the input field. That maybe causing it to be considered the value when you use serialize(). I actually just tested it and it works as expected. See here: http://jsfiddle.net/XrVvM/