You need to sign in to do that
Don't have an account?
Hardik Chavda
How to call javascript functions in if condition oncomplete method?
Hi,
I have to call javascript functions oncomplete method but using if condition. Actually I can call using if condition but the issue which I'm facing is that I am not able to use controller variable for coparision in if codition. Can anyone help me with this? Following is the code.
"CurrentPos" and "totalQuestion" both are controller variable.
I have to call javascript functions oncomplete method but using if condition. Actually I can call using if condition but the issue which I'm facing is that I am not able to use controller variable for coparision in if codition. Can anyone help me with this? Following is the code.
<apex:commandButton styleClass="btn btn-primary" action="{!NextAssessment}" value="Next " oncomplete="if(!currentPos == totalQuestion){return;}else{onPageRerender();endProcess();}" onclick="startProcess();" reRender="AssessmentBody,op1,op2" />The issue here is that in oncomplete method, I'm not able to compare those two controller variable, I guess It's not getting value from controller. Can anyone suggest me right syntex how to use "if(!currentPos == totalQuestion)" ?
"CurrentPos" and "totalQuestion" both are controller variable.
I think, you can compare controller variables in js also if they are string or numbers. did you tried something like below
if that doesn't work i would prefer to have two button but render one at a time depending on condition like below
Thanks!