DarkPrince2005 Posted March 22, 2008 Share Posted March 22, 2008 can anybody tell me why my javascript isn't working <html> <head> <title></title> <script language="JavaScript" type="text/JavaScript"> <!--//hide script function checkme() { if (document.form1.informed.checked) { document.form1.current_host2.disabled=false; document.form1.getElementById("myList").disabled=false; }else{ document.form1.current_host2.disabled=true; document.form1.getElementById("myList").disabled=true; } } // ---> </script> </head> <body topmargin="0" bottommargin="0" rightmargin="0" leftmargin="0"> <center><table height="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td width="735" height="150" background="top.gif"> </td> </tr> <tr> <td width="735" height="32" background="nav.gif" valign="top"> <font size="2"> <b><a href="index.html">Home</a> | <a href="contact_us.html">Contact Us</a> | <a href="http://www.geekforce.co.za/geekhost_support.html">Support</a> | <a href="https://secure.konsoleh.co.za">Mail Login</a> | <a href=" http://dsl.wadns.net">ADSL Console</a> | <a href="terms.html">Terms & Conditions</a></font></b></td> </tr> <tr> <td width="735" background="main2.gif" align="center" valign="top"><br><div class="scrollable"> <table width="675"> <tr> <td valign="top"><br> </td> <td valign="top"><br> </td> <td valign="top" align="center"><form name="form1" action="" method=""> <table width="650"> <tr> <td colspan="3"><font color="#3C00FF"><b><u><h3>Register a new domain: Step 1</h3></u></b></font></td> </tr> <tr> <td colspan="2"><font color="#FF6600">What is your existing domain name?</font></td> <td><input type="text" name="domain_name1" size="35"> . <input type="text" name="domain_name_type" size="5"> </td> <td></td> </tr> <tr> <td colspan="2"><font color="#FF6600">With who is it currently hosted?</font></td> <td><input type="text" name="current_host" size="35"></td> <td></td> </tr> <tr> <td colspan="2"> </td> <td><input type="checkbox" name="informed" value="informed" onChange="checkme();"> I have informed <input type="text" name="current_host2" size="35" disabled> that I will be moving my domain.</td> <td></td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="2"><font color="#FF6600">Please select your hosting package:</font></td> <td><select id="myList" onchange="favBrowser();" disabled><option value="">- SELECT -</option> <option value="Geek Entry">Geek Entry</option> <option value="Geek Micro">Geek Micro</option> <option value="Geek Icon">Geek Icon</option> <option value="Geek Value">Geek Value</option> <option value="Geek Pro">Geek Pro</option></select> </td> <td></td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3"><hr></td> </tr> <tr> <td colspan="3"><br> <table> <tr> <td colspan="3"><input type="text" id="package" size="22" disabled></td> </tr> <tr> <td width="100"><b><font color="#FF6600">Monthly:</font></b></td> <td colspan="2" align="left"><input type="text" id="favorite" size="5" disabled></td> </tr> <tr> <td><b><font color="#FF6600">Once Off:</font></b></td> <td colspan="2"><input type="text" id="favorite1" size="5" disabled></td> </tr> <tr> <td><b><font color="#FF6600">Total Due:</font></b></td> <td colspan="2"><input type="text" id="favorite2" size="5" disabled></td> </tr> </table></td> </tr> </table></form></div> </td> </tr> </table> </td> </tr> <tr> <td width="735" height="42" background="bottom.gif"> </td> </tr> </table> Quote Link to comment Share on other sites More sharing options...
haku Posted March 23, 2008 Share Posted March 23, 2008 Can you tell us what you mean by "isn't working"? Quote Link to comment Share on other sites More sharing options...
DarkPrince2005 Posted March 23, 2008 Author Share Posted March 23, 2008 It doesn't enable the drop down box Quote Link to comment Share on other sites More sharing options...
haku Posted March 24, 2008 Share Posted March 24, 2008 Check out this script, it should be able to help you: view-source:http://www.devguru.com/features/kb/kb100212_form.asp Its the script behind this page: http://www.devguru.com/features/kb/kb100212_form.asp Your problem may also lie in the fact that you are using deprecated methods to navigate the DOM (document.form1.current_host2 for example). The method of traversing the DOM by element names is outdated now. You are better of using getElementById and/or getElementsByTagName and similar methods. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.