This is a discussion on "document.getElementById and document.getElementByName is not working in FF" within the JavaScript Forum section. This forum, and the thread "document.getElementById and document.getElementByName is not working in FF are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
document.getElementById and document.getElementByName is not working in FF
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
document.getElementById and document.getElementByName is not working in FF
Hi every body,
document.getElementById and document.getElementByName is not working in FF this my code: <HTML> <script> function Foo(){ // if(document.getElementById('button')) if(document.getElementByName('button')) { alert('gi'); document.myform.button.disabled = true;} } function check(){ if(document.myform.Lee.checked) document.myform.button.disabled = true; else document.myform.button.disabled = false; } </script> <BODY> <br><br><br><br><br> <form name='myform'> <table cellspacing="0" cellpadding="0" width="100" align="center"> <tr align="left" valign="top" ><td>User Name : <input type = "text" size=25> </td> </tr> <tr align="left" valign="top" ><td>Passowrd : <input type = "password" size=25> </td> </tr> <tr align="left" valign="top" > <td align=right><input type = "checkbox" size=35 name="Lee" onclick='check()'> Remember my username </td> </tr> <tr align="left" valign="top" > <td align="center"><input type="button" onclick="Foo()" name='button' value="Login"></td> </tr> </table></form> </BODY> </HTML> Any one help me how to solve this problem.. |
|
|
|
|||
|
Re: document.getElementById and document.getElementByName is not working in FF
try changing the names to ids, that should help, i didn't know there was a getElementByName() function...
|
|
|||
|
Re: document.getElementById and document.getElementByName is not working in FF
Personally I dont like name, ID should always be unique so I tend to stick with that, as for why it isn't working
|
![]() |
| Tags |
| getelementbyid, getelementbyname |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help using document.getElementById | jonnymorris | JavaScript Forum | 3 | Mar 28th, 2008 22:52 |
| document.getElementById("userProfileCheck") is not working in Mozilla Firefox | dhineraj | JavaScript Forum | 1 | Jul 20th, 2007 05:32 |
| document.getElementById is not working in Mozilla Firefox | dhineraj | JavaScript Forum | 3 | Jul 20th, 2007 02:31 |
| document.getElementById[objectID].style now working on Mozilla Browser | yogeshid | JavaScript Forum | 1 | May 25th, 2007 09:30 |
| new problem. document.getElementById().width returning unassigned. why? | sanchopansa | JavaScript Forum | 2 | Jul 22nd, 2006 20:23 |