Re: Re: deleting records using a checkbox

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



on 3/20/03 1:45 AM, olinux at olnx@yahoo.com appended the following bits to
my mbox:

> [ and ] are illegal characters. #javascript

I'm coming into this a bit late, so I'm not sure exactly what you wish to
do.

You can use JavaScript to refer to checkbox items in the format:

document.forms[formindex].elements[elementindex].property

In my MySTRI database table administration program, I have an "x" button
that allows you to select all displayed rows to mark for deletion.  The
button looks like:

<input 
type="button" 
title="Check/Uncheck All"
value=" X " 
onclick="
for (var q = 0; q < document.forms[1].length; q++) {
document.forms[1].elements[q].checked =
!document.forms[1].elements[q].checked;
}
">

The checkbox fields look like:

<input type="checkbox" name="delete_rows[]" value="25679">

Not as easy as referring to the name element, but it works very well.

Another idea is to use "id" elements for JavaScript / DOM interaction and
reserve the "name" elements for php.  That should work on any modern browser
(sorry, no Netscape 4.x).

HTH.

Sincerely,

Paul Burney
<http://paulburney.com/>

<?php
    while ($self != "asleep") {
        $sheep_count++;
    }
?>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux