Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

javascript to either enable or disable the dropdown

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
zlf - 12 Feb 2008 14:24 GMT
I need a javascript to either enable or disable the dropdowns when the user
clicks on the checkbox and do NOT post back to the server.
I tried the following, but it does not work. How to correct it?

AssignToQueueCheckBox.Attributes["oncheckedchanged"] =
   "document.getElementById('ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder2$WorkUnitDropDownList').disable=!document.getElementById('ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder2$WorkUnitDropDownList').disable;"
+

Thanks

zlf
bruce barker - 12 Feb 2008 16:31 GMT
as there is no "oncheckedchanged" event for a checkbox, you are just defining
a custom attribute. try: "onclick"

also it really a bad practice to view source to get the control names, you
shouald ask the control for is ClientID:

-- bruce (sqlwork.com)

> I need a javascript to either enable or disable the dropdowns when the user
> clicks on the checkbox and do NOT post back to the server.
[quoted text clipped - 7 lines]
>
> zlf
zlf - 12 Feb 2008 17:53 GMT
"onclick" does not work too :(

"bruce barker" <brucebarker@discussions.microsoft.com> дÈëÏûÏ¢ÐÂÎÅ:F64E8F05-6FE8-44DB-AC31-8A3848E40045@microsoft.com...
> as there is no "oncheckedchanged" event for a checkbox, you are just
> defining
[quoted text clipped - 18 lines]
>>
>> zlf

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.