ratcateme Posted February 3, 2008 Share Posted February 3, 2008 i have this table when i click on a line the tick box is checked and a new style is applied to change the background this is my form Code: <table> <tr class="normal" onmousedown="if(document.getElementById('check_15569').checked==true){ document.getElementById('check_15569').checked=false; alert(this.class); this.class=''; alert(this.class); }else{ document.getElementById('check_15569').checked=true; alert(this.class); this.class='normal_checked'; alert(this.class); }document.getElementById('check_15569').checked"> <td><input type="checkbox" name="rows_selected[]" value="15569" id="check_15569" /></td> <td>10.1.1.2</td> <td>2008/02/03 07:37 PM</td> <td>GET</td> <td>/update_logs.php</td> <td>200</td> <td>27</td> <td>Firefox 2.0</td> </tr> </table> The tick box get ticked but i get undefined on the first alert and the class i am trying to change to in the second alert i am trying to create a display somewhat like phpMyAdmin if this helps Scott. Quote Link to comment Share on other sites More sharing options...
JacobYaYa Posted February 3, 2008 Share Posted February 3, 2008 This is JavaScript and having a quick look at that mess you have on "onmousedown" on that <tr> I can't really see any problem so you maybe post all your JavaScript from the <script> tags etc. Quote Link to comment Share on other sites More sharing options...
ratcateme Posted February 3, 2008 Author Share Posted February 3, 2008 i worked it out after looking over the js file from phpMyAdmin i was trying to set object.class .class dosn't exist i needed to set .className 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.