function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TheSFDeveloperTheSFDeveloper 

Attached onChange event of Picklist field of SalesForce

Hi All,

As per the requirement I want to take some action when picklist selection change.

Example: Something like I have two drop down boxes, 1. Country and 2. State

Based on the Country drop down value i want to populate the pre-defined states in the states drop down without doing the postback.

I have heard something about AJAX-enabled s-control but not sure how to use it also if anyone has an idea about attaching an event like "onchange" to the picklist control to fulfill the requirement.

Please suggest.

Thank You,
Vishal
jpizzalajpizzala
Doesn't sound like you code at all for this.  Have you checked out Field Dependencies?

Field Dependencies allow you to set one field as the controlling field (in your case, Country) and one as the dependent field (State).  When a value is chosen for Country, the values in State will automatically populate with the appropriate values.

Check out Dependent Fields in the Help section.