I have a variable whos value i am setting on click of command button. I have a 2nd command button and i want to use the new value of the variable set previously. vf:
<apex:commandButton styleclass="btn btn btn-primary" id="generate" action="{!generate}" value="Generate" style="margin-top:20px;margin-left:5px;" reRender="" oncomplete="return false;"/>
<apex:commandButton styleClass="btn-primary" onclick=" if(!fncValidate()){return false;}" id="vieweLineStatusButton" value="Submit" disabled="false" reRender="" oncomplete="return false;" />
script:
<script>
function fncValidate(){
var one = '{!first}';
alert(one);
return true;
}
</script>
apex:
public String first{get; set;}
public PageReference generate(){
first = '1111';
return null;
}
i am always getting null in my js