0

Hi I am trying to disable a dropdownlist in an asp.net web application whenever the selected index is changed. I have the following javascript in my web app but whenever it gets to the disabled = true line it is falling over. What I want to know is that the correct way to disable a dropdownlist in javascript. The dropdown list is part of a usercontrol which is on the web form so I am not sure how to do this?

DateDrop is the name of the dropdownlist on the usercontrol.
Form1 is the name of the form

function SubmitOnChange(dateOnChange)
{
var temp = dateOnChange.options[dateOnChange.selectedIndex].value;
document.Form1.Hid2.value = temp;
document.Form1.DateDrop.disabled=true;
document.Form1.submit;
}

2
Contributors
1
Reply
3
Views
12 Years
Discussion Span
Last Post by alpha_foobar
0

Well the code looks ok... and the attribute disabled exists in the DOM.

However, the next line is a form submit (assuming you are using VB script.. otherwise it being accessed as an attribute instead of a function). But my point is that this function call will submit the form and forward the user to a new page, or back to the current page. So there isn't any point manipulating the current page - it will get refreshed soon anyway.

I'm presuming your using .NET? ihatedotnet.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.