Skip to content Skip to sidebar Skip to footer

Passing Variable Sized Form Using JQuery To PHP File For Processing

I have a form that is of variable size (length) that is populated from a MySQL db. There are 4 fields that make up the information used to create a button (id, button#, name and pr

Solution 1:

Since you don't know the number of inputs, you can use serialize in jquery to serialize the entire form. Here's the manual.

From the manual,

 $('form').submit(function() {
  alert($(this).serialize());
  return false;
 });

This produces a standard-looking query string:

a=1&b=2&c=3&d=4&e=5

Post a Comment for "Passing Variable Sized Form Using JQuery To PHP File For Processing"