Serializing Form Data With Field Names That Have Dots

Is the serialization function in jQuery replacing periods ('.') With underscores?

For example, I have a form field like:

<input id="Project.name" name="Project.name" type="text">

      

When the form is POSTED, I serialize the form data and submit it to another PHP file to save. Dots seem to be converted to underscores. Is this normal behavior?

+2


a source to share


1 answer


jQuery doesn't do this, the easiest way to see it is to check it, you can see it here . It was a time when I was doing something in PHP for me, but it looks like something is happening on the server side.

Here's a simple test:

<form>
  <input id="Project.name" name="Project.name" type="text" value="test" />
</form>

      



This jQuery:

alert($("form").serialize()); // "Project.name=test"

      

Another easy way to see what's really going on is with Firebug or any other traffic inspection tool of your choice.

+2


a source







All Articles