function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Swamy P R NSwamy P R N 

Unable to pass a parameter by a actionfunction

Hi Buddies,
I was not able to pass the parameters via actionfunction to the controller. Even controller is not executed by clicking the button. Please check it and let me know where i need to change.
VF Page:
      <apex:commandButton value="Next" style="width:90px;margin-left:360px;" onclick="changeValue();"/>
    <script>
        function changeValue() {
           var c=document.getElementById("mradio").value;
            priorityval(c);
            alert(c);
        }
    </script>
    <apex:actionFunction name="priorityval" action="{!runPriority}">
          <apex:param name="priorityname" value="" assignTo="{!priorityname}"/>
      </apex:actionFunction>
Class:
 public string priorityname{get;set;}
    Public Pagereference runPriority(){
        System.debug('Priority Value@@@'+priorityname+'**RecrdTypeId**'+recrdtypeid);
        PageReference pgRef=new PageReference('/apex/CasePage?RecordType='+recrdtypeid+'&priority='+priorityname);
        pgRef.setRedirect(true);
    return pgRef;   
 }

Please advice me, Thanks in advance!!
Best Answer chosen by Swamy P R N
rebvijkumrebvijkum
u need to use rerender attribute on actionfunction, the value for it can be dummy value. than it works

All Answers

SonamSonam (Salesforce Developers) 
Try to change onclick="changeValue();" to onclick="changeValue()" to make the button work

 
Swamy P R NSwamy P R N
Hi Sonam,

The script is also executing, i tried with alert boxes. Over in the alert box the value is populating correctly but it is not passing via actionfunction method that means, " priorityval(c); "

Am not able to pass the parameter to that actionfunction method, i face the issue over here. Plz update me with your suggestions.
rebvijkumrebvijkum
u need to use rerender attribute on actionfunction, the value for it can be dummy value. than it works
This was selected as the best answer