Used html button instead of apex command button, but only old values are passing to contrller action method why? Its working fine for commandbutton!!

    <apex:actionFunction name="initiateactionmethod" reRender="basicid" action="{!updatedetails}" status="AjaxLoader" oncomplete="window.location.reload( true );">


 <input type="button" class="button-a blue"  onclick="initiateMethod();"  value="save"/>

previous command button::

<apex:commandButton value="Save"   styleClass="button-a blue"  action="{!updatedetails}" />

1 Answer 1


Values from your page are sent to a controller on form submit. You can see this if you view HTML code generated by your visualforce page <apex:commandButton/> will be an input with type="submit".

So try changing the type of your button:

 <input type="submit" class="button-a blue"  onclick="initiateMethod();"  value="save"/>
  • ok i will try this Feb 23, 2016 at 14:08
  • its working fine ,but i need to send values from javascript for that fields its not working Feb 23, 2016 at 15:03
  • if i keep submit its only submitting form data Feb 23, 2016 at 15:03
  • I`m not sure that I understand what do you need now. If you need to excecute javascript before submit, call it in onclick and then call actionfunction from there. Feb 23, 2016 at 15:15
  • thanks Oles Malkov,i have implemented this successfully,working fine, Mar 2, 2016 at 10:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .