You need to sign in to do that
Don't have an account?

js change apex inputHidden value then post to controller, value missing
page:
<apex:form id ="myForm">
<apex:inputHidden value="{!value1}" id="theHiddenInput"/>
<apex:commandLink value="Save" action="{!save}"/>
<script>
document.getElementById('{!$Component.myForm.theHiddenInput}').value= "lalala";
</script>
controller:
public String value1{get;set;}
public PageReference save(){ system.debug('invalue1 ' + value1); return null; }
question:
when i try to submit this form about 30 times, i will meet the value1's value in log is empty 1 time, and also use fiddler to watch form data, also found the theHiddenInput's value is empty. why? a low percentage to lost the hiddeninput value? anyonu meet this issue before?
tks
check below code its works for me: