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. Link to comment https://forums.phpfreaks.com/topic/89176-solved-changing-class/ 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. Link to comment https://forums.phpfreaks.com/topic/89176-solved-changing-class/#findComment-456664 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 Link to comment https://forums.phpfreaks.com/topic/89176-solved-changing-class/#findComment-456667 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.