You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Setting the value of a hidden field to the display text value from a drop list

We use a picklist for our country drop downs in forms where the value matches the country code in SFDC.  It's a ugly string of characters that gives you no clue what the country value is when you see a notification email.

I am personally not great with javascript, but I've managed to get the country display value added to a hidden field so it is sent in the notification email with lots of googling.  To save you from googling here is the javascript:

//set value of hidden field from drop down list display textfunction ddlselect () {//set d to the drop down list var d = document.getElementById("fe44703");//grab the display text of the selected item var displaytext=d.options[d.selectedIndex].text;//set the value of the hidden fielddocument.getElementById("fe44715").value=displaytext;}window.onload = function() {document.getElementById("fe44703").addEventListener("change", ddlselect);}
Tagged:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!