473,396 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Grabbing checkbox values

I've got a dynamically built form with checkboxes for each element ( a
list of file names in a directory). I need to grab only those checkboxes
that are checked, so I can then delete those files.

Does each checkbox name have to be unique? I was hoping to just group
them under one name, and select from that array.

PHP is not my native language - I'm coming at this from Perl, so bear
with me, things are a little different in that country.

I've tried:
foreach ($_REQUEST as $field =$value)
{
echo "$field = $value<br>";
}
but that just grabs the last entry in the group.

The line in question is:
<input type="checkbox" name="DeleteThis" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 12 '06 #1
29 3102
Amer Neely wrote:
I've got a dynamically built form with checkboxes for each element ( a
list of file names in a directory). I need to grab only those checkboxes
that are checked, so I can then delete those files.

Does each checkbox name have to be unique? I was hoping to just group
them under one name, and select from that array.

PHP is not my native language - I'm coming at this from Perl, so bear
with me, things are a little different in that country.

I've tried:
foreach ($_REQUEST as $field =$value)
{
echo "$field = $value<br>";
}
but that just grabs the last entry in the group.

The line in question is:
<input type="checkbox" name="DeleteThis" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>
I've changed the code for the above line so the name now is unique for
each element. That now lets me grab whichever one/s are checked. But,
another problem has arisen.

I also have a JavaScript toggle to 'Select/Unselect All' checkboxes,
which works fine. But the 'checked' status doesn't seem to be getting
passed to the PHP code. So, when I display the items checked, it is
incorrect. Refreshing the page also doesn't seem to correct it. Only
physically clicking the checkboxes seems to work.

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 12 '06 #2

Amer Neely wrote:
I've got a dynamically built form with checkboxes for each element ( a
list of file names in a directory). I need to grab only those checkboxes
that are checked, so I can then delete those files.

Does each checkbox name have to be unique? I was hoping to just group
them under one name, and select from that array.

PHP is not my native language - I'm coming at this from Perl, so bear
with me, things are a little different in that country.

I've tried:
foreach ($_REQUEST as $field =$value)
{
echo "$field = $value<br>";
}
but that just grabs the last entry in the group.

The line in question is:
<input type="checkbox" name="DeleteThis" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
in html, if your checkbox is called "blah123" then when its checked it
will have the variable name of blah123 with a value of blah123, if it
is unchecked then blah123==null. the easy way is:

if (!empty($_POST['blah123'])) { do stuff }

Flamer.

Nov 12 '06 #3
php is not to "grab" the checkboxes, it comes and goes as lessons for
the yum mathematical calus on webpage stuff!
Use the html to expose your own web pages!

Amer Neely wrote:
I've got a dynamically built form with checkboxes for each element ( a
list of file names in a directory). I need to grab only those checkboxes
that are checked, so I can then delete those files.

Does each checkbox name have to be unique? I was hoping to just group
them under one name, and select from that array.

PHP is not my native language - I'm coming at this from Perl, so bear
with me, things are a little different in that country.

I've tried:
foreach ($_REQUEST as $field =$value)
{
echo "$field = $value<br>";
}
but that just grabs the last entry in the group.

The line in question is:
<input type="checkbox" name="DeleteThis" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 12 '06 #4
flamer di******@hotmail.com wrote:
Amer Neely wrote:
>I've got a dynamically built form with checkboxes for each element ( a
list of file names in a directory). I need to grab only those checkboxes
that are checked, so I can then delete those files.

Does each checkbox name have to be unique? I was hoping to just group
them under one name, and select from that array.

PHP is not my native language - I'm coming at this from Perl, so bear
with me, things are a little different in that country.

I've tried:
foreach ($_REQUEST as $field =$value)
{
echo "$field = $value<br>";
}
but that just grabs the last entry in the group.

The line in question is:
<input type="checkbox" name="DeleteThis" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>

in html, if your checkbox is called "blah123" then when its checked it
will have the variable name of blah123 with a value of blah123, if it
is unchecked then blah123==null. the easy way is:

if (!empty($_POST['blah123'])) { do stuff }

Flamer.
Hmmm. OK, so I will need to also walk through each of the new input
names, and check them with the 'empty' function. I'll work on that. Thanks.
--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 12 '06 #5
flamer di******@hotmail.com wrote:
Amer Neely wrote:
>I've got a dynamically built form with checkboxes for each element ( a
list of file names in a directory). I need to grab only those checkboxes
that are checked, so I can then delete those files.

Does each checkbox name have to be unique? I was hoping to just group
them under one name, and select from that array.

PHP is not my native language - I'm coming at this from Perl, so bear
with me, things are a little different in that country.

I've tried:
foreach ($_REQUEST as $field =$value)
{
echo "$field = $value<br>";
}
but that just grabs the last entry in the group.

The line in question is:
<input type="checkbox" name="DeleteThis" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"

in html, if your checkbox is called "blah123" then when its checked it
will have the variable name of blah123 with a value of blah123, if it
is unchecked then blah123==null. the easy way is:

if (!empty($_POST['blah123'])) { do stuff }

Flamer.
I can now grab the selected elements, but only if they are selected by
mouse clicks. If I use the JavaScript toggle to select/unselect all,
nothing gets passed to the PHP. This works in Perl, so it has to be
doable in PHP I would think.

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 12 '06 #6
..oO(flamer di******@hotmail.com)
>in html, if your checkbox is called "blah123" then when its checked it
will have the variable name of blah123 with a value of blah123
It will have the value of the 'value' attribute.
>if it
is unchecked then blah123==null.
If unchecked then the checkbox is not submitted at all.

Micha
Nov 12 '06 #7
..oO(Amer Neely)
>I've got a dynamically built form with checkboxes for each element ( a
list of file names in a directory). I need to grab only those checkboxes
that are checked, so I can then delete those files.
Only checked checkboxes will be submitted by the browser.
>Does each checkbox name have to be unique?
No, you can use the same name, but different values. To make this work
in PHP you have to add brackets to the name, see below.
>I've tried:
foreach ($_REQUEST as $field =$value)
{
echo "$field = $value<br>";
}
but that just grabs the last entry in the group.

The line in question is:
<input type="checkbox" name="DeleteThis" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>
Some things:

1) You should not use $_REQUEST. This array contains data from different
sources, so you don't know where all the values actually came from. Use
the array that corresponds with the used method in your form, which
should be $_POST in this case.

2) Instead of $allfiles[$i] you can just use the variable $i as the
value of your checkboxes, that's enough. When processing the form use
that value to lookup the filenames in your $allfiles array.

3) To process multiple form controls that share the same name you have
to add square brackets to their name, e.g. "DeleteThis[]". This causes
PHP to store all the values in an array instead of a scalar.

So the code could look something like this:

if (isset($_POST['DeleteThis')) {
foreach ($_POST['DeleteThis'] as $index) {
if (isset($allfiles[$index])) {
// perform action to delete the file
}
}
}

The code for the checkboxes like I would probably write it:

printf("<label><index type='checkbox' name='DeleteThis[]'
value='%u'>&nbsp;%s</label><br>\n", $i, $allfiles[$i]);

HTH
Micha
Nov 12 '06 #8
script, not html, this way post becomes fully clear.

Rogats wrote:
php is not to "grab" the checkboxes, it comes and goes as lessons for
the yum mathematical calus on webpage stuff!
Use the html to expose your own web pages!

Amer Neely wrote:
I've got a dynamically built form with checkboxes for each element ( a
list of file names in a directory). I need to grab only those checkboxes
that are checked, so I can then delete those files.

Does each checkbox name have to be unique? I was hoping to just group
them under one name, and select from that array.

PHP is not my native language - I'm coming at this from Perl, so bear
with me, things are a little different in that country.

I've tried:
foreach ($_REQUEST as $field =$value)
{
echo "$field = $value<br>";
}
but that just grabs the last entry in the group.

The line in question is:
<input type="checkbox" name="DeleteThis" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 12 '06 #9
after you succeed, post your reply, I want to know how also.

Amer Neely wrote:
>
Hmmm. OK, so I will need to also walk through each of the new input
names, and check them with the 'empty' function. I'll work on that. Thanks.
Nov 12 '06 #10
Michael Fesser wrote:
.oO(Amer Neely)
>I've got a dynamically built form with checkboxes for each element ( a
list of file names in a directory). I need to grab only those checkboxes
that are checked, so I can then delete those files.

Only checked checkboxes will be submitted by the browser.
>Does each checkbox name have to be unique?

No, you can use the same name, but different values. To make this work
in PHP you have to add brackets to the name, see below.
>I've tried:
foreach ($_REQUEST as $field =$value)
{
echo "$field = $value<br>";
}
but that just grabs the last entry in the group.

The line in question is:
<input type="checkbox" name="DeleteThis" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>

Some things:

1) You should not use $_REQUEST. This array contains data from different
sources, so you don't know where all the values actually came from. Use
the array that corresponds with the used method in your form, which
should be $_POST in this case.

2) Instead of $allfiles[$i] you can just use the variable $i as the
value of your checkboxes, that's enough. When processing the form use
that value to lookup the filenames in your $allfiles array.

3) To process multiple form controls that share the same name you have
to add square brackets to their name, e.g. "DeleteThis[]". This causes
PHP to store all the values in an array instead of a scalar.

So the code could look something like this:

if (isset($_POST['DeleteThis')) {
foreach ($_POST['DeleteThis'] as $index) {
if (isset($allfiles[$index])) {
// perform action to delete the file
}
}
}

The code for the checkboxes like I would probably write it:

printf("<label><index type='checkbox' name='DeleteThis[]'
value='%u'>&nbsp;%s</label><br>\n", $i, $allfiles[$i]);

HTH
Micha
I can get the checked boxes only if the user clicks them with the mouse.
Which is fine, but I also have some JavaScript that lets me toggle the
boxes 'select / unselect all'. This is the part that is now giving me
grief. In Perl I can do:

my @infiles=param('DeleteThis');

which gets an array of all checked entries in the 'DeleteThis' group.
And this works with my JavaScript code. The 'param' function is part of
a perl module (CGI.pm) that deals with form parsing. Is there anything
like that for PHP? It would make life so much easier.

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 12 '06 #11
Amer Neely wrote:
flamer di******@hotmail.com wrote:
>Amer Neely wrote:
>>I've got a dynamically built form with checkboxes for each element ( a
list of file names in a directory). I need to grab only those checkboxes
that are checked, so I can then delete those files.

Does each checkbox name have to be unique? I was hoping to just group
them under one name, and select from that array.

PHP is not my native language - I'm coming at this from Perl, so bear
with me, things are a little different in that country.

I've tried:
foreach ($_REQUEST as $field =$value)
{
echo "$field = $value<br>";
}
but that just grabs the last entry in the group.

The line in question is:
<input type="checkbox" name="DeleteThis" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>


in html, if your checkbox is called "blah123" then when its checked it
will have the variable name of blah123 with a value of blah123, if it
is unchecked then blah123==null. the easy way is:

if (!empty($_POST['blah123'])) { do stuff }

Flamer.

Hmmm. OK, so I will need to also walk through each of the new input
names, and check them with the 'empty' function. I'll work on that. Thanks.

Amer,

No. It's much easier than that. Have all the checkboxes names the
same, with square brackets ( "[]" ) following. The you will be able to
use an array on the PHP side, i.e.
<input type="checkbox" name="DeleteThis[]" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>>
To process the input, all you need is:

foreach ($_POST['DeleteThis'] as $delfile) {
// Validate the filename is OK here
unlink $delfile;
}

This will work whether the checkbox is set via a mouse click or javascript.

Of course, you will want to validate your filenames. That part I left
out because I have no idea what the criteria is.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 12 '06 #12
Deniel Keplar wrote:
after you succeed, post your reply, I want to know how also.

Amer Neely wrote:
>Hmmm. OK, so I will need to also walk through each of the new input
names, and check them with the 'empty' function. I'll work on that. Thanks.
Will do.

In the mean time, here is the JS code I use to toggle checkboxes on or
off. You will have to edit to suit your situation. Specifically, this is
hard-coded to work on the first form on a page (forms[0]) so you would
change that to either a form name or specify which form you want to work
with.

function CheckAll(value) // toggles checkboxes on/off
{
for (i=0; i < document.forms[0].length; i++)
{
document.forms[0].elements[i].value);
if ( document.forms[0].elements[i].name =~ 'DeleteThis')
{
document.forms[0].elements[i].checked=value;
}
}
}

The function is called like this:
<a href="#" style="color:red; text-decoration:none"
onClick="CheckAll(1);return false;">Select All</a>&nbsp;•&nbsp;<a
style="color:red; text-decoration:none" href="#" onClick="CheckAll(0);
return false;">Unselect All<br /></a>

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 12 '06 #13
Jerry Stuckle wrote:
Amer Neely wrote:
>flamer di******@hotmail.com wrote:
>>Amer Neely wrote:

I've got a dynamically built form with checkboxes for each element ( a
list of file names in a directory). I need to grab only those
checkboxes
that are checked, so I can then delete those files.

Does each checkbox name have to be unique? I was hoping to just group
them under one name, and select from that array.

PHP is not my native language - I'm coming at this from Perl, so bear
with me, things are a little different in that country.

I've tried:
foreach ($_REQUEST as $field =$value)
{
echo "$field = $value<br>";
}
but that just grabs the last entry in the group.

The line in question is:
<input type="checkbox" name="DeleteThis" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>
in html, if your checkbox is called "blah123" then when its checked it
will have the variable name of blah123 with a value of blah123, if it
is unchecked then blah123==null. the easy way is:

if (!empty($_POST['blah123'])) { do stuff }

Flamer.

Hmmm. OK, so I will need to also walk through each of the new input
names, and check them with the 'empty' function. I'll work on that.
Thanks.


Amer,

No. It's much easier than that. Have all the checkboxes names the
same, with square brackets ( "[]" ) following. The you will be able to
use an array on the PHP side, i.e.
<input type="checkbox" name="DeleteThis[]" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>>
To process the input, all you need is:

foreach ($_POST['DeleteThis'] as $delfile) {
// Validate the filename is OK here
unlink $delfile;
}

This will work whether the checkbox is set via a mouse click or javascript.

Of course, you will want to validate your filenames. That part I left
out because I have no idea what the criteria is.
OK, I have your code inserted, but it gives me an error when I use my
'Select All' JS:

Warning: Invalid argument supplied for foreach() in show_spam4.php on
line 116

If I click any box with the mouse it returns 'on' for the output.

[116] foreach ($_POST['DeleteThis'] as $value)
{
echo "$value<br>";
}

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 12 '06 #14
Deniel Keplar wrote:
after you succeed, post your reply, I want to know how also.

Amer Neely wrote:
>Hmmm. OK, so I will need to also walk through each of the new input
names, and check them with the 'empty' function. I'll work on that. Thanks.
Found a couple of good articles here:
http://www.webreference.com/programming/php/

Follow Part 1 and Part 2.

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 13 '06 #15
Amer Neely wrote:
Jerry Stuckle wrote:
>Amer Neely wrote:
>>flamer di******@hotmail.com wrote:

Amer Neely wrote:

I've got a dynamically built form with checkboxes for each element ( a
list of file names in a directory). I need to grab only those
checkboxes
that are checked, so I can then delete those files.
>
Does each checkbox name have to be unique? I was hoping to just group
them under one name, and select from that array.
>
PHP is not my native language - I'm coming at this from Perl, so bear
with me, things are a little different in that country.
>
I've tried:
foreach ($_REQUEST as $field =$value)
{
echo "$field = $value<br>";
}
but that just grabs the last entry in the group.
>
The line in question is:
<input type="checkbox" name="DeleteThis" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>

in html, if your checkbox is called "blah123" then when its checked it
will have the variable name of blah123 with a value of blah123, if it
is unchecked then blah123==null. the easy way is:

if (!empty($_POST['blah123'])) { do stuff }

Flamer.
Hmmm. OK, so I will need to also walk through each of the new input
names, and check them with the 'empty' function. I'll work on that.
Thanks.


Amer,

No. It's much easier than that. Have all the checkboxes names the
same, with square brackets ( "[]" ) following. The you will be able
to use an array on the PHP side, i.e.
<input type="checkbox" name="DeleteThis[]" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>>
To process the input, all you need is:

foreach ($_POST['DeleteThis'] as $delfile) {
// Validate the filename is OK here
unlink $delfile;
}

This will work whether the checkbox is set via a mouse click or
javascript.

Of course, you will want to validate your filenames. That part I left
out because I have no idea what the criteria is.

OK, I have your code inserted, but it gives me an error when I use my
'Select All' JS:

Warning: Invalid argument supplied for foreach() in show_spam4.php on
line 116

If I click any box with the mouse it returns 'on' for the output.

[116] foreach ($_POST['DeleteThis'] as $value)
{
echo "$value<br>";
}
Amer,

I didn't mean for that to be the only code. Rather it was a guide to
get you going in the right direction.

The invalid argument is probably because none of the checkboxes are
checked, so you're not getting anything in your PHP code. To make sure
you're getting good information, check out isset() and isarray() functions.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 13 '06 #16
Jerry Stuckle wrote:
Amer Neely wrote:
>Jerry Stuckle wrote:
>>Amer Neely wrote:

flamer di******@hotmail.com wrote:

Amer Neely wrote:
>
>I've got a dynamically built form with checkboxes for each element
>( a
>list of file names in a directory). I need to grab only those
>checkboxes
>that are checked, so I can then delete those files.
>>
>Does each checkbox name have to be unique? I was hoping to just group
>them under one name, and select from that array.
>>
>PHP is not my native language - I'm coming at this from Perl, so bear
>with me, things are a little different in that country.
>>
>I've tried:
> foreach ($_REQUEST as $field =$value)
> {
> echo "$field = $value<br>";
> }
>but that just grabs the last entry in the group.
>>
>The line in question is:
><input type="checkbox" name="DeleteThis" value="<?php
>echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>
>
>
>
in html, if your checkbox is called "blah123" then when its checked it
will have the variable name of blah123 with a value of blah123, if it
is unchecked then blah123==null. the easy way is:
>
if (!empty($_POST['blah123'])) { do stuff }
>
Flamer.
>

Hmmm. OK, so I will need to also walk through each of the new input
names, and check them with the 'empty' function. I'll work on that.
Thanks.

Amer,

No. It's much easier than that. Have all the checkboxes names the
same, with square brackets ( "[]" ) following. The you will be able
to use an array on the PHP side, i.e.
<input type="checkbox" name="DeleteThis[]" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>>
To process the input, all you need is:

foreach ($_POST['DeleteThis'] as $delfile) {
// Validate the filename is OK here
unlink $delfile;
}

This will work whether the checkbox is set via a mouse click or
javascript.

Of course, you will want to validate your filenames. That part I
left out because I have no idea what the criteria is.

OK, I have your code inserted, but it gives me an error when I use my
'Select All' JS:

Warning: Invalid argument supplied for foreach() in show_spam4.php on
line 116

If I click any box with the mouse it returns 'on' for the output.

[116] foreach ($_POST['DeleteThis'] as $value)
{
echo "$value<br>";
}

Amer,

I didn't mean for that to be the only code. Rather it was a guide to
get you going in the right direction.

The invalid argument is probably because none of the checkboxes are
checked, so you're not getting anything in your PHP code. To make sure
you're getting good information, check out isset() and isarray() functions.
:) Sorry, I'm new with PHP so everything is literal. But as I mentioned,
if I check all the boxes with JS, and submit the form, it throws that
error. I'm going to do some reading and see what I can come up with.
Thanks for the input and direction so far.

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 13 '06 #17
Amer Neely wrote:
Jerry Stuckle wrote:
>Amer Neely wrote:
>>Jerry Stuckle wrote:

Amer Neely wrote:

flamer di******@hotmail.com wrote:
>
>Amer Neely wrote:
>>
>>I've got a dynamically built form with checkboxes for each
>>element ( a
>>list of file names in a directory). I need to grab only those
>>checkboxes
>>that are checked, so I can then delete those files.
>>>
>>Does each checkbox name have to be unique? I was hoping to just
>>group
>>them under one name, and select from that array.
>>>
>>PHP is not my native language - I'm coming at this from Perl, so
>>bear
>>with me, things are a little different in that country.
>>>
>>I've tried:
>> foreach ($_REQUEST as $field =$value)
>> {
>> echo "$field = $value<br>";
>> }
>>but that just grabs the last entry in the group.
>>>
>>The line in question is:
>><input type="checkbox" name="DeleteThis" value="<?php
>>echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>
>>
>>
>>
>>
>in html, if your checkbox is called "blah123" then when its
>checked it
>will have the variable name of blah123 with a value of blah123, if it
>is unchecked then blah123==null. the easy way is:
>>
>if (!empty($_POST['blah123'])) { do stuff }
>>
>Flamer.
>>
>
Hmmm. OK, so I will need to also walk through each of the new input
names, and check them with the 'empty' function. I'll work on that.
Thanks.
>
>

Amer,

No. It's much easier than that. Have all the checkboxes names the
same, with square brackets ( "[]" ) following. The you will be able
to use an array on the PHP side, i.e.
<input type="checkbox" name="DeleteThis[]" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>>
To process the input, all you need is:

foreach ($_POST['DeleteThis'] as $delfile) {
// Validate the filename is OK here
unlink $delfile;
}

This will work whether the checkbox is set via a mouse click or
javascript.

Of course, you will want to validate your filenames. That part I
left out because I have no idea what the criteria is.
OK, I have your code inserted, but it gives me an error when I use my
'Select All' JS:

Warning: Invalid argument supplied for foreach() in show_spam4.php on
line 116

If I click any box with the mouse it returns 'on' for the output.

[116] foreach ($_POST['DeleteThis'] as $value)
{
echo "$value<br>";
}

Amer,

I didn't mean for that to be the only code. Rather it was a guide to
get you going in the right direction.

The invalid argument is probably because none of the checkboxes are
checked, so you're not getting anything in your PHP code. To make
sure you're getting good information, check out isset() and isarray()
functions.

:) Sorry, I'm new with PHP so everything is literal. But as I mentioned,
if I check all the boxes with JS, and submit the form, it throws that
error. I'm going to do some reading and see what I can come up with.
Thanks for the input and direction so far.
I would suggest your javascript isn't doing it's job. When I check
boxes with js the do appear in PHP.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 13 '06 #18
Jerry Stuckle wrote:
Amer Neely wrote:
>Jerry Stuckle wrote:
>>Amer Neely wrote:

Jerry Stuckle wrote:

Amer Neely wrote:
>
>flamer di******@hotmail.com wrote:
>>
>>Amer Neely wrote:
>>>
>>>I've got a dynamically built form with checkboxes for each
>>>element ( a
>>>list of file names in a directory). I need to grab only those
>>>checkboxes
>>>that are checked, so I can then delete those files.
>>>>
>>>Does each checkbox name have to be unique? I was hoping to just
>>>group
>>>them under one name, and select from that array.
>>>>
>>>PHP is not my native language - I'm coming at this from Perl, so
>>>bear
>>>with me, things are a little different in that country.
>>>>
>>>I've tried:
>>> foreach ($_REQUEST as $field =$value)
>>> {
>>> echo "$field = $value<br>";
>>> }
>>>but that just grabs the last entry in the group.
>>>>
>>>The line in question is:
>>><input type="checkbox" name="DeleteThis" value="<?php
>>>echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>
>>>
>>>
>>>
>>>
>>in html, if your checkbox is called "blah123" then when its
>>checked it
>>will have the variable name of blah123 with a value of blah123,
>>if it
>>is unchecked then blah123==null. the easy way is:
>>>
>>if (!empty($_POST['blah123'])) { do stuff }
>>>
>>Flamer.
>>>
>>
>Hmmm. OK, so I will need to also walk through each of the new
>input names, and check them with the 'empty' function. I'll work
>on that. Thanks.
>>
>>
>
Amer,
>
No. It's much easier than that. Have all the checkboxes names the
same, with square brackets ( "[]" ) following. The you will be
able to use an array on the PHP side, i.e.
>
>
<input type="checkbox" name="DeleteThis[]" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>>
>
>
To process the input, all you need is:
>
foreach ($_POST['DeleteThis'] as $delfile) {
// Validate the filename is OK here
unlink $delfile;
}
>
This will work whether the checkbox is set via a mouse click or
javascript.
>
Of course, you will want to validate your filenames. That part I
left out because I have no idea what the criteria is.
>

OK, I have your code inserted, but it gives me an error when I use
my 'Select All' JS:

Warning: Invalid argument supplied for foreach() in show_spam4.php
on line 116

If I click any box with the mouse it returns 'on' for the output.

[116] foreach ($_POST['DeleteThis'] as $value)
{
echo "$value<br>";
}
Amer,

I didn't mean for that to be the only code. Rather it was a guide to
get you going in the right direction.

The invalid argument is probably because none of the checkboxes are
checked, so you're not getting anything in your PHP code. To make
sure you're getting good information, check out isset() and isarray()
functions.

:) Sorry, I'm new with PHP so everything is literal. But as I
mentioned, if I check all the boxes with JS, and submit the form, it
throws that error. I'm going to do some reading and see what I can
come up with. Thanks for the input and direction so far.

I would suggest your javascript isn't doing it's job. When I check
boxes with js the do appear in PHP.
That isn't the problem - they appear just fine in the page. I can toggle
them off and on all night.

It's only when the page is submitted that the values don't seem to be
getting through.

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 13 '06 #19
Amer Neely wrote:
Jerry Stuckle wrote:
>Amer Neely wrote:
>>Jerry Stuckle wrote:

Amer Neely wrote:

Jerry Stuckle wrote:
>
>Amer Neely wrote:
>>
>>flamer di******@hotmail.com wrote:
>>>
>>>Amer Neely wrote:
>>>>
>>>>I've got a dynamically built form with checkboxes for each
>>>>element ( a
>>>>list of file names in a directory). I need to grab only those
>>>>checkboxes
>>>>that are checked, so I can then delete those files.
>>>>>
>>>>Does each checkbox name have to be unique? I was hoping to just
>>>>group
>>>>them under one name, and select from that array.
>>>>>
>>>>PHP is not my native language - I'm coming at this from Perl,
>>>>so bear
>>>>with me, things are a little different in that country.
>>>>>
>>>>I've tried:
>>>> foreach ($_REQUEST as $field =$value)
>>>> {
>>>> echo "$field = $value<br>";
>>>> }
>>>>but that just grabs the last entry in the group.
>>>>>
>>>>The line in question is:
>>>><input type="checkbox" name="DeleteThis" value="<?php
>>>>echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>in html, if your checkbox is called "blah123" then when its
>>>checked it
>>>will have the variable name of blah123 with a value of blah123,
>>>if it
>>>is unchecked then blah123==null. the easy way is:
>>>>
>>>if (!empty($_POST['blah123'])) { do stuff }
>>>>
>>>Flamer.
>>>>
>>>
>>Hmmm. OK, so I will need to also walk through each of the new
>>input names, and check them with the 'empty' function. I'll work
>>on that. Thanks.
>>>
>>>
>>
>Amer,
>>
>No. It's much easier than that. Have all the checkboxes names
>the same, with square brackets ( "[]" ) following. The you will
>be able to use an array on the PHP side, i.e.
>>
>>
><input type="checkbox" name="DeleteThis[]" value="<?php
>echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>>
>>
>>
>To process the input, all you need is:
>>
> foreach ($_POST['DeleteThis'] as $delfile) {
> // Validate the filename is OK here
> unlink $delfile;
> }
>>
>This will work whether the checkbox is set via a mouse click or
>javascript.
>>
>Of course, you will want to validate your filenames. That part I
>left out because I have no idea what the criteria is.
>>
>
OK, I have your code inserted, but it gives me an error when I use
my 'Select All' JS:
>
Warning: Invalid argument supplied for foreach() in show_spam4.php
on line 116
>
If I click any box with the mouse it returns 'on' for the output.
>
[116] foreach ($_POST['DeleteThis'] as $value)
{
echo "$value<br>";
}
>

Amer,

I didn't mean for that to be the only code. Rather it was a guide
to get you going in the right direction.

The invalid argument is probably because none of the checkboxes are
checked, so you're not getting anything in your PHP code. To make
sure you're getting good information, check out isset() and
isarray() functions.
:) Sorry, I'm new with PHP so everything is literal. But as I
mentioned, if I check all the boxes with JS, and submit the form, it
throws that error. I'm going to do some reading and see what I can
come up with. Thanks for the input and direction so far.

I would suggest your javascript isn't doing it's job. When I check
boxes with js the do appear in PHP.

That isn't the problem - they appear just fine in the page. I can toggle
them off and on all night.

It's only when the page is submitted that the values don't seem to be
getting through.
Then you need to check your javascript code. It doesn't make any
difference to PHP whether the checkbox is checked by the user or JS - in
fact, there is no way for PHP to tell.

If the box is checked, the client sends it to the server when the form
is submitted. If the box is not checked, the client does not submit it
to the server. There is no "checked by user" or "checked by javascript"
flag. It's either checked or not checked.

And the fact it isn't going to the browser indicates it's not checked,
or you've done something else with your javascript.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 13 '06 #20
..oO(Amer Neely)
>Jerry Stuckle wrote:
>The invalid argument is probably because none of the checkboxes are
checked, so you're not getting anything in your PHP code. To make sure
you're getting good information, check out isset() and isarray() functions.

:) Sorry, I'm new with PHP so everything is literal.
I already posted some code similar to Jerry's, but with the required
isset() check to avoid the error message you got.

Micha
Nov 13 '06 #21
..oO(Amer Neely)
>:) Sorry, I'm new with PHP so everything is literal. But as I mentioned,
if I check all the boxes with JS, and submit the form, it throws that
error. I'm going to do some reading and see what I can come up with.
There's an error in your script. Try this one (tested, works here):

function CheckAll(value) {
for (i=0; i<document.forms[0].length; i++) {
if (document.forms[0].elements[i].name = 'DeleteThis[]') {
document.forms[0].elements[i].checked=value;
}
}
}

Micha
Nov 13 '06 #22
..oO(Amer Neely)
>:) Sorry, I'm new with PHP so everything is literal. But as I mentioned,
if I check all the boxes with JS, and submit the form, it throws that
error. I'm going to do some reading and see what I can come up with.
There's an error in your script. Try this one (tested, works here):

function CheckAll(value) {
for (i=0; i<document.forms[0].length; i++) {
if (document.forms[0].elements[i].name == 'DeleteThis[]') {
document.forms[0].elements[i].checked=value;
}
}
}

Micha
Nov 13 '06 #23
Jerry Stuckle wrote:
Amer Neely wrote:
>Jerry Stuckle wrote:
>>Amer Neely wrote:

Jerry Stuckle wrote:

Amer Neely wrote:
>
>Jerry Stuckle wrote:
>>
>>Amer Neely wrote:
>>>
>>>flamer di******@hotmail.com wrote:
>>>>
>>>>Amer Neely wrote:
>>>>>
>>>>>I've got a dynamically built form with checkboxes for each
>>>>>element ( a
>>>>>list of file names in a directory). I need to grab only those
>>>>>checkboxes
>>>>>that are checked, so I can then delete those files.
>>>>>>
>>>>>Does each checkbox name have to be unique? I was hoping to
>>>>>just group
>>>>>them under one name, and select from that array.
>>>>>>
>>>>>PHP is not my native language - I'm coming at this from Perl,
>>>>>so bear
>>>>>with me, things are a little different in that country.
>>>>>>
>>>>>I've tried:
>>>>> foreach ($_REQUEST as $field =$value)
>>>>> {
>>>>> echo "$field = $value<br>";
>>>>> }
>>>>>but that just grabs the last entry in the group.
>>>>>>
>>>>>The line in question is:
>>>>><input type="checkbox" name="DeleteThis" value="<?php
>>>>>echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>in html, if your checkbox is called "blah123" then when its
>>>>checked it
>>>>will have the variable name of blah123 with a value of blah123,
>>>>if it
>>>>is unchecked then blah123==null. the easy way is:
>>>>>
>>>>if (!empty($_POST['blah123'])) { do stuff }
>>>>>
>>>>Flamer.
>>>>>
>>>>
>>>Hmmm. OK, so I will need to also walk through each of the new
>>>input names, and check them with the 'empty' function. I'll work
>>>on that. Thanks.
>>>>
>>>>
>>>
>>Amer,
>>>
>>No. It's much easier than that. Have all the checkboxes names
>>the same, with square brackets ( "[]" ) following. The you will
>>be able to use an array on the PHP side, i.e.
>>>
>>>
>><input type="checkbox" name="DeleteThis[]" value="<?php
>>echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>>
>>>
>>>
>>To process the input, all you need is:
>>>
>> foreach ($_POST['DeleteThis'] as $delfile) {
>> // Validate the filename is OK here
>> unlink $delfile;
>> }
>>>
>>This will work whether the checkbox is set via a mouse click or
>>javascript.
>>>
>>Of course, you will want to validate your filenames. That part I
>>left out because I have no idea what the criteria is.
>>>
>>
>OK, I have your code inserted, but it gives me an error when I use
>my 'Select All' JS:
>>
>Warning: Invalid argument supplied for foreach() in show_spam4.php
>on line 116
>>
>If I click any box with the mouse it returns 'on' for the output.
>>
>[116] foreach ($_POST['DeleteThis'] as $value)
>{
> echo "$value<br>";
>}
>>
>
Amer,
>
I didn't mean for that to be the only code. Rather it was a guide
to get you going in the right direction.
>
The invalid argument is probably because none of the checkboxes are
checked, so you're not getting anything in your PHP code. To make
sure you're getting good information, check out isset() and
isarray() functions.
>

:) Sorry, I'm new with PHP so everything is literal. But as I
mentioned, if I check all the boxes with JS, and submit the form, it
throws that error. I'm going to do some reading and see what I can
come up with. Thanks for the input and direction so far.
I would suggest your javascript isn't doing it's job. When I check
boxes with js the do appear in PHP.

That isn't the problem - they appear just fine in the page. I can
toggle them off and on all night.

It's only when the page is submitted that the values don't seem to be
getting through.

Then you need to check your javascript code. It doesn't make any
difference to PHP whether the checkbox is checked by the user or JS - in
fact, there is no way for PHP to tell.

If the box is checked, the client sends it to the server when the form
is submitted. If the box is not checked, the client does not submit it
to the server. There is no "checked by user" or "checked by javascript"
flag. It's either checked or not checked.

And the fact it isn't going to the browser indicates it's not checked,
or you've done something else with your javascript.
See my reply to Deniel Keplar earlier. My JS code is in there, and how I
use it. If you can implement it in some test code and see what PHP does
with it that would help I think.

I think I need to just play with some code and check whether a checkbox
'isset' or not, or whether it's 'on' or not.

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 13 '06 #24
Michael Fesser wrote:
.oO(Amer Neely)
>:) Sorry, I'm new with PHP so everything is literal. But as I mentioned,
if I check all the boxes with JS, and submit the form, it throws that
error. I'm going to do some reading and see what I can come up with.

There's an error in your script. Try this one (tested, works here):

function CheckAll(value) {
for (i=0; i<document.forms[0].length; i++) {
if (document.forms[0].elements[i].name == 'DeleteThis[]') {
document.forms[0].elements[i].checked=value;
}
}
}

Micha
When you say it 'work's, does that mean your PHP tells you upon form
submission which boxes were checked? Mine works fine IF AND ONLY IF I
check the boxes with the mouse, even though the JS code will toggle them
on or off perfectly.

I had been playing with name of the field. First it was hard-coded to
'DeleteThis', then a suggestion was that it should be an array, so I
changed it to 'DeleteThis[]'. That didn't seem to work, so I went back
to 'DeleteThis', and changed the code to this:
if ( document.forms[0].elements[i].name =~ 'DeleteThis')
to catch everthing.

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 13 '06 #25
..oO(Amer Neely)
>When you say it 'work's, does that mean your PHP tells you upon form
submission which boxes were checked?
Yep. The problem with your script was the operator '=~', which doesn't
exist in JS. Use a '==' and it works.
>Mine works fine IF AND ONLY IF I
check the boxes with the mouse, even though the JS code will toggle them
on or off perfectly.
The problem was this part:

document.forms[0].elements[i].name =~ 'DeleteThis'

'=~' is not an operator recognized by JS. It is interpreted as an
assignment operator, followed by a bitwise negation of its operand!

I don't know for sure what the JS engine does if you try to negate a
string, but it look as if it's casted to an integer first, which is 0 in
this case. After bitwise negation it became -1 (two's complement), which
then got assigned to each control's name. A simple

var_dump($_POST);

at the beginning of the PHP script shows that.

Micha
Nov 13 '06 #26
Michael Fesser wrote:
.oO(Amer Neely)
>When you say it 'work's, does that mean your PHP tells you upon form
submission which boxes were checked?

Yep. The problem with your script was the operator '=~', which doesn't
exist in JS. Use a '==' and it works.
>Mine works fine IF AND ONLY IF I
check the boxes with the mouse, even though the JS code will toggle them
on or off perfectly.

The problem was this part:

document.forms[0].elements[i].name =~ 'DeleteThis'

'=~' is not an operator recognized by JS. It is interpreted as an
assignment operator, followed by a bitwise negation of its operand!

I don't know for sure what the JS engine does if you try to negate a
string, but it look as if it's casted to an integer first, which is 0 in
this case. After bitwise negation it became -1 (two's complement), which
then got assigned to each control's name. A simple

var_dump($_POST);

at the beginning of the PHP script shows that.

Micha
ARghhh! That's my perl coming through. '=~' is a common regex operator
for matching strings. In JS I'll have to define a variable with my pattern.

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 13 '06 #27
Michael Fesser wrote:
.oO(Amer Neely)
>I've got a dynamically built form with checkboxes for each element ( a
list of file names in a directory). I need to grab only those checkboxes
that are checked, so I can then delete those files.

Only checked checkboxes will be submitted by the browser.
>Does each checkbox name have to be unique?

No, you can use the same name, but different values. To make this work
in PHP you have to add brackets to the name, see below.
>I've tried:
foreach ($_REQUEST as $field =$value)
{
echo "$field = $value<br>";
}
but that just grabs the last entry in the group.

The line in question is:
<input type="checkbox" name="DeleteThis" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>

Some things:

1) You should not use $_REQUEST. This array contains data from different
sources, so you don't know where all the values actually came from. Use
the array that corresponds with the used method in your form, which
should be $_POST in this case.

2) Instead of $allfiles[$i] you can just use the variable $i as the
value of your checkboxes, that's enough. When processing the form use
that value to lookup the filenames in your $allfiles array.

3) To process multiple form controls that share the same name you have
to add square brackets to their name, e.g. "DeleteThis[]". This causes
PHP to store all the values in an array instead of a scalar.

So the code could look something like this:

if (isset($_POST['DeleteThis')) {
foreach ($_POST['DeleteThis'] as $index) {
if (isset($allfiles[$index])) {
// perform action to delete the file
}
}
}

The code for the checkboxes like I would probably write it:

printf("<label><index type='checkbox' name='DeleteThis[]'
value='%u'>&nbsp;%s</label><br>\n", $i, $allfiles[$i]);

HTH
Micha
OK, I've got my JS / PHP working with the checkboxes finally.

I changed my checkbox definition so that each box has a unique name:
<input type="checkbox" name="DeleteThis_<?php echo("$i")?>" value="<?php
echo("$allfiles[$i]")?>">&nbsp;<?php echo("$allfiles[$i]")?><br>

where: $i is a loop index; $allfiles is an array of filenames

I changed my JS to check for a 'checkbox' type rather than looking for a
name:
function CheckAll(value) // toggles checkboxes on/off
{
for (i=0; i < document.forms[0].length; i++)
{
if (document.forms[0].elements[i].type == 'checkbox')
{
document.forms[0].elements[i].checked=value;
}
}
}

Then in my PHP I check the boxes:
foreach ($_POST as $field =$value)
{
if (!empty($_POST[$field]))
{
echo "$value<br>";
}
}

Now I can go and delete only those files that are checked, whether by JS
or mouse-click.

My thanks to everyone for their input and direction. Another fine
example of how newsgroups are supposed to work.

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 13 '06 #28
Amer Neely wrote:
Jerry Stuckle wrote:
>>
Then you need to check your javascript code. It doesn't make any
difference to PHP whether the checkbox is checked by the user or JS -
in fact, there is no way for PHP to tell.

If the box is checked, the client sends it to the server when the form
is submitted. If the box is not checked, the client does not submit
it to the server. There is no "checked by user" or "checked by
javascript" flag. It's either checked or not checked.

And the fact it isn't going to the browser indicates it's not checked,
or you've done something else with your javascript.

See my reply to Deniel Keplar earlier. My JS code is in there, and how I
use it. If you can implement it in some test code and see what PHP does
with it that would help I think.

I think I need to just play with some code and check whether a checkbox
'isset' or not, or whether it's 'on' or not.
Amer,

If you change the name to DeleteThis[], you've also got to change the
JavaScript code to reflect the name.

And Michael also pointed out the other error in your code. Use his code
- it works fine.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 13 '06 #29
Jerry Stuckle wrote:
Amer Neely wrote:
>Jerry Stuckle wrote:
>>>
Then you need to check your javascript code. It doesn't make any
difference to PHP whether the checkbox is checked by the user or JS -
in fact, there is no way for PHP to tell.

If the box is checked, the client sends it to the server when the
form is submitted. If the box is not checked, the client does not
submit it to the server. There is no "checked by user" or "checked
by javascript" flag. It's either checked or not checked.

And the fact it isn't going to the browser indicates it's not
checked, or you've done something else with your javascript.

See my reply to Deniel Keplar earlier. My JS code is in there, and how
I use it. If you can implement it in some test code and see what PHP
does with it that would help I think.

I think I need to just play with some code and check whether a
checkbox 'isset' or not, or whether it's 'on' or not.

Amer,

If you change the name to DeleteThis[], you've also got to change the
JavaScript code to reflect the name.

And Michael also pointed out the other error in your code. Use his code
- it works fine.

I've made a few changes in both the JS and PHP, and have solved the
problem (see my latest post under this subject heading) :: SOLVED.

Again thanks for the input and insight.

--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
Nov 13 '06 #30

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Angelos | last post by:
I have this list of logs stored in a MySQL DB. I display them in a list and next to each log I have a del view LINK I want to add Checkboxes next to each log and keep del and view links as...
4
by: Jack | last post by:
Hi, I have a checkbox the value which goes to a database via a asp page that builds the sql string. In the front end asp page, the checkbox code is written as follows: <i><input...
4
by: Vanessa | last post by:
I have an ASP script which is used to upload files with Persits.Upload.1 object. But I can't get the values from mutliple checkboxes in the form like normally. <form method="post"...
1
by: evanburen | last post by:
I'm passing the name of a div and the name of checkbox to this function which either hides or displays the div. My problem is this line // var the_box =...
1
by: J Talbot | last post by:
Hi Was wondering if anyone could help me with this problem : If I have three checkboxes with different values on a form like : <input type="checkbox" name="checkbox" value="1stValue">...
0
by: cyberdawg999 | last post by:
Greetings all in ASP land I have overcome one obstacle that took me 2 weeks to overcome and I did it!!!!! I am so elated!! thank you to all who invested their time and energy towards helping me...
1
by: txguy | last post by:
have a page with lotsa checkboxes, am using javascript to count the number of boxes checked and to total the prices for all boxes checked. would like to pass the "description" of each checkbox but...
10
by: LionsDome | last post by:
Hello, I have a vb.net page which a bunch of checkboxes. A user can select a checkbox(s) and hit the submit button to store those values in a SQL Server table. This works fine with no problem...
9
by: raamay | last post by:
I have six checkboxes as shown below: <table> <tr> <td><input name="spec1" type="checkbox" value="0" tabindex="11" /><label id="label">Bridge Construction</label></td> </tr> <tr> <td><input...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.