disable dropdownlist with javascript

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jul 2005
Posts: 3
Reputation: iloveorangesoda is an unknown quantity at this point 
Solved Threads: 0
iloveorangesoda iloveorangesoda is offline Offline
Newbie Poster

disable dropdownlist with javascript

 
0
  #1
Jul 31st, 2005
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;
}
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 182
Reputation: alpha_foobar is an unknown quantity at this point 
Solved Threads: 3
alpha_foobar's Avatar
alpha_foobar alpha_foobar is offline Offline
Junior Poster

Re: disable dropdownlist with javascript

 
0
  #2
Aug 1st, 2005
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC