You need to sign in to do that
Don't have an account?
Bryant Daniels 46
set apex param values from javascript DOM
Hello I was trying to figure out how i can set the value on a Apex Param
here is my visualforce:
<button onclick="done();" class="btn btn right" type="button" id="doneButton" style="border: none; background: none; width: 100px; background-color: #dcdcdc; color: #ffffff;">Done</button>
<apex:actionFunction action="{!done}" name="SetHiddenValue" reRender="">
<apex:param name="brandCode" value="" assignto="{!iaFet.Brand_CD__c}" id="brandCode" />
</apex:actionFunction>
and my java script where i get the values that i need:
function getRequiredValues(){
var brandCodeVal = $('#brandDropdown option:selected').val();
console.log(brandCodeVal);
}
when i run this i get the value that i want in the console.log but i am trying to figure out how i can pass that value to the apex: param value so then i can assign it to something in my controller and save the record with the value.
here is my visualforce:
<button onclick="done();" class="btn btn right" type="button" id="doneButton" style="border: none; background: none; width: 100px; background-color: #dcdcdc; color: #ffffff;">Done</button>
<apex:actionFunction action="{!done}" name="SetHiddenValue" reRender="">
<apex:param name="brandCode" value="" assignto="{!iaFet.Brand_CD__c}" id="brandCode" />
</apex:actionFunction>
and my java script where i get the values that i need:
function getRequiredValues(){
var brandCodeVal = $('#brandDropdown option:selected').val();
console.log(brandCodeVal);
}
when i run this i get the value that i want in the console.log but i am trying to figure out how i can pass that value to the apex: param value so then i can assign it to something in my controller and save the record with the value.
Or you can call the javascript function and call the action function from within the javascript
Hope that helps!