Gathering data from many inputs

AFAIK, when a form has no method specified, such as with

<form id="serv">

It defaults to GET

Try adding a method POST to the form tag.

I do not think it matters what method is specified in the form tag as long it is specified in the parameters of the AJAX request as seen above…

It is an AJAX request anyway…

This

should be

data: $( "#serv" ).serialize(),

by using an extra key you destroy all the prepared work.

If you want the top level key to be named ‘serviceinfo’, exchange ‘form’ by that in the field names.

1 Like

this seems to be the solution…

Your former version used the already serialised data and serialised them again (since $.ajax() received an object as payload).

so you are saying $.ajax performs another serialization by default

only if the data given to $.ajax are not a string.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.