| | |
OnClick/OnChange not working in IE
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2008
Posts: 198
Reputation:
Solved Threads: 0
Hi,
I have a checkbox on click of which I'm calling a JavaScript function to disable another checkbox. The onClick event is not working in both Firefox/IE. I am capturing onChange event of the checkbox1 as of now which works in Firefox, but not working in IE.
Please suggest a way to implement this. This is urgent.
Thanx.
I have a checkbox on click of which I'm calling a JavaScript function to disable another checkbox. The onClick event is not working in both Firefox/IE. I am capturing onChange event of the checkbox1 as of now which works in Firefox, but not working in IE.
Please suggest a way to implement this. This is urgent.
Thanx.
*Not working* is not a very helpful description of the problem. You should try debugging your script and inspecting variables to see if they are causing a problem. Use the Microsoft Script Debugger if using IE and Firebug if using Firefox.
Also, onclick works:
Also, onclick works:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Title</title> <META http-equiv="Content-Type" content="text/html; charset=utf8"> <script type="text/javascript"> function doDisable(elem, id) { var e = document.getElementById(id); if(!e || !elem) return; e.disabled = elem.checked; } </script> </head> <body id="bdy"> <form name="frm" id="frm" action="#"> <div id="container"> <input type="checkbox" id="chk1" name="chk1"> <br><br> <input type="checkbox" id="chk2" name="chk2" onclick="doDisable(this, 'chk1');"> </div> </form> </body> </html>
I don't accept change; I don't deserve to live.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
![]() |
Similar Threads
- javascript onclick is not working in IE7 & IE6 (JavaScript / DHTML / AJAX)
- How to get the javascript objects in html body tag (JavaScript / DHTML / AJAX)
- login box not working (JavaScript / DHTML / AJAX)
- Urgent.....Dynamic Changes.... (JavaScript / DHTML / AJAX)
- Accessing JavaScript objects in the Body Tag (JSP)
- Accessing DOM Objects (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: How to Create tool tip using(Ajax , php and javascript)
- Next Thread: Ajax Help
Views: 2924 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
acid2 ajax ajaxexample ajaxjspservlets array automatically autoplay beta blackjack boarder box button captcha card cart codes column css date debugger decimal design developer dom download element embed enter error events firefox flash focus form frameworks gears getselection google gwt hiddenvalue hint html htmlform ie7 iframe index java javascript javascripthelp2020 javascripts jquery jsp libcurl listbox maps marquee masterpage media menu microsoft mimic mp4 offline onerror onmouseover parameters paypal php player position post problem programming prototype rating redirect safari scale scriptlets search security select size software sources starrating toggle tweet twitter unicode validation variables w3c web webkit webservice website window windowofwords xml






