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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -