Skip to Content

TheBlogReaders.com

Salesforce.com, PHP, MySQL, Javascript, Ajax, Htacces

Pass the Picklist value in Javascript Onchange using Visualforce page

Be First!

Pass the Picklist value in Javascript Onchange using Visualforce page

Visualforce page use the below codes:

<apex:inputField value=”{!Account.Status}”  onchange=”foo(this.id);” id=”AccStatus”/>

Even better approach will be to send current element to JavaScript function rather than passing only id & then finding same element.

<apex:inputField value=”{!Account.Status}”  onchange=”foo(this);” id=”AccStatus”/>

Javascript Function
function foo(data){
alert(“Call came “);//this is displyed
alert(‘********The field value is ********’+data.value);
}

(0)

Previous
Next

Leave a Reply