Spaces/Official ESi/Scriptaculous & Adv. Tags

Mark a Datalink Using a Dropdown Filter

John Cashin
posted this on February 26, 2009 17:09

This code can be called, usually through an onSubmit event, to mark a datalink to true if the correct value is selected in a dropdown. In this example the datalink would only be marked true when "List Value to Mark Link True" was selected in the dropdown.

function checkDatalink() 
{ 
if(document.forms[0].Name_of_Your_List.options[document.forms[0].Name_of_Your_List.options.selectedIndex].text == 'List Value to Mark Link True') 
{ 
document.forms[0].datalinkid.checked = true; 
} 
}