to pass the id into a JS function, try something like this:
scriptText.Append(“<function>(categoryDropdownID)” & vbCrLf)
scriptText.Append(“var categoryDropdown = document.getElementById(categoryDropdownID);” & vbCrLf)
and, to check if the dropdownlist has a selected value in JS, use something like this:
scriptText.Append(String.Concat(“if(categoryDropdown[categoryDropdown.selectedIndex].value == <value>)”, vbCrLf))
i don’t have the exact source i’m quoting in front of me, but essentially you’re – passing the DropDownListUniqueID into the JS function to be able to reference the object directly in page code. you are then adding the ID to a variable. then you can compare the control to see if it has a selected value. elegant – probably not. will i use it again – probably.
maybe you can use this, i’m sure i will need this later.