You need to sign in to do that
Don't have an account?
krishna casukhela 7
How to pass inputHiddenfield value to apex controller
Hello
I have like this in my visualforce page
<apex:page controller="somename">
<apex:form>
<apex:inputHiddenField value="{!firstname}" id="hiddenfield">
<apex:inputText value="{!firstName}" id="fname" onchange="GetFirstName(this);" />
<apex:commandButton value="Save" action="{!SaveChanges}"/>
</apex:form>
<script type="text/javascript">
function GetFirstName(data)
{
var hiddenvalue=document.getElementByID('data').value;
alert(hiddenfield); // am getting the correct value in alert
}
</script>
</apex:page>
Now what I require is to have value of javascript variable(hiddenvalue) in my apex controller.
I want to do some action when I click the button so inside button code I need to have the value of javascript variable.
I hope I am clear.
without using action function or apex:param is there a way to do this?
pls let me know, urgent.
thanks
krishna
I have like this in my visualforce page
<apex:page controller="somename">
<apex:form>
<apex:inputHiddenField value="{!firstname}" id="hiddenfield">
<apex:inputText value="{!firstName}" id="fname" onchange="GetFirstName(this);" />
<apex:commandButton value="Save" action="{!SaveChanges}"/>
</apex:form>
<script type="text/javascript">
function GetFirstName(data)
{
var hiddenvalue=document.getElementByID('data').value;
alert(hiddenfield); // am getting the correct value in alert
}
</script>
</apex:page>
Now what I require is to have value of javascript variable(hiddenvalue) in my apex controller.
I want to do some action when I click the button so inside button code I need to have the value of javascript variable.
I hope I am clear.
without using action function or apex:param is there a way to do this?
pls let me know, urgent.
thanks
krishna
Hope this will help.
can u pls clarify, should it be on change of inputText?
also how do I get the value into my controller.?
Thanks
Krishna