[nycphp-talk] Javascript "select all" feature?
Phillip Powell
phillip.powell at adnet-sys.com
Wed Apr 14 09:43:56 EDT 2004
It was a misprint, sorry.. here is more of the code snippet including
the <form> tag:
<form name="imageForm" method=post action=index.php>
<tr>
<td colspan=6>
<table border=0 width=100%>
<tr>
<td bgcolor=eeeedd colspan=3><a href=index.php?section=image&action=edit&chooseAlbum=1&album=mu-spin>Go back to your previous listing</a></td>
</tr>
<tr>
<td bgcolor=ddddee>Image (click to view)</td> <td bgcolor=ddddee>Click to view image metadata if link is found</td> <td bgcolor=ddddee> </td>
</tr>
<script>
<!--
function selectAll(checkState, selectStatus, obj) {
if (document.imageForm.select_all.checked || document.imageForm.deselect_all.checked) {
for (i = 0; i < obj.length; i++) {
obj[i].checked = checkState;
}
if (selectStatus.toLowerCase() == 'select') document.imageForm.deselect_all.checked = false;
if (selectStatus.toLowerCase() == 'deselect') document.imageForm.select_all.checked = false;
}
}
//-->
</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 onClick="selectAll(true, 'select', document.imageForm['move[]'])"> - Select All <input type=checkbox name="deselect_all" value=1 onClick="selectAll(false, 'deselect', document.imageForm['move[]'])"> - De-Select All</td>
</tr>
Phil
jon baer wrote:
>Might be a misprint but I did not see a <form name="imageForm"> in the
>document you just posted. Which would mean unfortunatley IE is right to
>crap out :-\
>
>----- Original Message -----
>From: "Phillip Powell" <phillip.powell at adnet-sys.com>
>To: "NYPHP Talk" <talk at lists.nyphp.org>
>Sent: Wednesday, April 14, 2004 9:32 AM
>Subject: Re: [nycphp-talk] Javascript "select all" feature?
>
>
>
>
>>Ok, back to the drawing board, it didn't work when my colleague tested
>>on his machine using IE 6.0 SP4 for Win2K:
>>
>>I tried with the HTML code below, but IE spat out the following:
>>
>>Line: 42
>>Char: 1
>>Error: 'document.imageForm.move[]' is null or not an object
>>Code: 0
>>URL: file://C:\Documents and Settings\eduardo\Desktop\test.html
>>
>>
>
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>
>
>
More information about the talk
mailing list