2

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 );">

        </apex:actionFunction> 

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

previous command button::

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

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"/>
| improve this answer | |
  • ok i will try this – Poornachandrarao Poolasetty Feb 23 '16 at 14:08
  • its working fine ,but i need to send values from javascript for that fields its not working – Poornachandrarao Poolasetty Feb 23 '16 at 15:03
  • if i keep submit its only submitting form data – Poornachandrarao Poolasetty Feb 23 '16 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. – Oles Malkov Feb 23 '16 at 15:15
  • thanks Oles Malkov,i have implemented this successfully,working fine, – Poornachandrarao Poolasetty Mar 2 '16 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.