Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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}" />
share|improve this question
up vote 3 down vote accepted

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"/>
share|improve this answer
    
thanks Oles Malkov, thanks for reply – Poornachandrarao Poolasetty Feb 23 '16 at 14:07
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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