JQuery Ajax submit button value null -


i using jquery, ajax , struts web application. trying submit when button clicked. have 4 tabs in 1 page. placed 4 buttons on each tab , want submit whole form when user clicked on button through ajax. when submit form, getting values form fields except button1 value null in form bean. have alternative track button clicked while submitting whole form? there way can pass additional parameter along submitting whole form in ajax? thank you!

$('[name=button1]').click(function() {     $.ajax(     {         type: "post",         url: "/nb/ajaxsubmit.do",         data: $('form[name=ajaxform]').serialize(), // serializes form's elements.         success: function(data)         {             alert(data); // show response php script.         }     });      return false; // avoid execute actual submit of form. });  <html:button property="button1"  value ="submit"></html:button> 

change type button submit ,button values not passed form values or append in button value in ajax url

  url: "/nb/ajaxsubmit.do?mybutton="+$('[name=button1]').attr('value'), 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -