pulpfiction Posted November 8, 2006 Share Posted November 8, 2006 Hi,There's a dynamically generated dropdown list using ASP. So the "name" for list is numeric. now I need to check the value of the DDL using javascript. but it throws error.... how to handle this?? HTML code:<select name='1' class='textbox'> <option value='Option1'>Option 1</option> <option value='Option2'>Option 2</option></select>java script: [ERROR]if (document.frm.1.value == 'option1') {.........}Hope it was clear.... TIA Link to comment Share on other sites More sharing options...
aspnetguy Posted November 8, 2006 Share Posted November 8, 2006 give it an id as well id="1" and select like thisvar sel = document.getElementById('1');if (sel.options[sel.selectedIndex].value == 'option1') Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now