jQuery form posting -
i using short script post data php processing page.
function get(){ $.post('data.php',{name: form.name.value}, function(output) { $('#age').hide().html(output).fadein(1000); } ); }
this send 1 input:
$.post('data.php',{name: form.name.value},
i wondering how alter script send more 1 ?
function get() { $.post('data.php', $('form').serialize(), function(output){ $('#age').hide().html(output).fadein(1000); }); }
this assumes want send form inputs. alternatively, replace object literal such as...
{ name: $('input[name="name"]').val(), age: $('#age').val() }
Comments
Post a Comment