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#, nam
What about something like this? http://jsfiddle.net/r0k3t/e6W3Z/ as you can see you can add any number of fields and they will all get dumped into qString.
$('#yourform').submit(function() {
var qString = "";
$('#yourform input[type=text]').each(function() {
qString += $(this).attr("id") + "=" + $(this).val() + "?";
});
console.log(qString);
return false;
});
From you question is appears that you can grab the values of the button because you do that elsewhere. Once you are happy with the query string you can use .post as Joe Brown suggested.