NYCPHP Meetup

NYPHP.org

[nycphp-talk] Javascript "select all" feature?

Phillip Powell phillip.powell at adnet-sys.com
Tue Apr 13 18:09:27 EDT 2004


Fails in IE, Opera and Konqueror, acts very buggy in Mozilla but 
slightly works:

<script>
<!--
  function selectAll(checkState, obj) {
   if (document.imageForm.select_all.checked || document.imageForm.deselect_all.checked) {
    for (i = 0; i < obj.length; i++) {
     obj[i].checked = checkState;
    }
   document.imageForm.select_all.checked = (document.imageForm.deselect_all.checked) ? false : true;
   document.imageForm.deselect_all.checked = (document.imageForm.select_all.checked) ? false : true;
  }
 }
//-->
</script>

 <tr>
  <td bgcolor=ffffff><a href="./images/mu-spin/kyrka.jpg">kyrka.jpg</a></td>
  <td bgcolor=ffffff>Show Metadata</td>
  <td bgcolor=ffffff><input type=checkbox name="move[]" value="kyrka.jpg"> - Move?</td>

 </tr>
 <tr>
  <td bgcolor=ffffcc><a href="./images/mu-spin/banner.jpg.jpeg">banner.jpg.jpeg</a></td>
  <td bgcolor=ffffcc><a href=index.php?section=image&action=edit&chooseAlbum=1&album=mu-spin&id=147>Show Metadata</a></td>
  <td bgcolor=ffffcc><input type=checkbox name="move[]" value="banner.jpg.jpeg"> - Move?</td>
 </tr>
 <tr>

  <td bgcolor=ffffff><a href="./images/mu-spin/kyrka_gray.jpg">kyrka_gray.jpg</a></td>
  <td bgcolor=ffffff><a href=index.php?section=image&action=edit&chooseAlbum=1&album=mu-spin&id=145>Show Metadata</a></td>
  <td bgcolor=ffffff><input type=checkbox name="move[]" value="kyrka_gray.jpg"> - Move?</td>
 </tr>
 <tr>
  <td colspan=3 bgcolor=ddddee>
   <input type=checkbox name="select_all" value=1 onChange="selectAll(true, document.imageForm['move[]'])"> - Select All&nbsp;&nbsp;<input type=checkbox name="deselect_all" value=1 onChange="selectAll(false, document.imageForm['move[]'])"> - De-Select All</td>

Phil



Chris Bielanski wrote:

>try enquoting your name variables...
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>
>  
>





More information about the talk mailing list