PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Dec 13, 2019 10:25 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Mar 19, 2004 6:23 pm 
Offline
Forum Newbie

Joined: Fri Mar 19, 2004 6:23 pm
Posts: 8
Summary: when i create a series of checkboxes using php, I cannot check if there is at least one checked or not.

and full story: in a script like bellow:
<?
echo "<form name=myform method=post action=test2.php>";
for ($i=0; $i<10; $i++)
{
echo "<input type=checkbox name=mycheckbox[] value=$i><br>";
}
echo "<input type=button onclick='myfunction()'>";
echo "</form>";
?>
if I dont' put [] in front of name attribute i wont be able to send values to the other page (test2.php). and if i put square brackets i cannot find the length of check boxes in my javascript function.

so how do I check if there is at least one checkbox is checked before submitting the form?


Top
 Profile  
 
PostPosted: Fri Mar 19, 2004 8:37 pm 
Offline
Forum Contributor

Joined: Wed Mar 10, 2004 2:52 pm
Posts: 282
Location: Columbus, Ohio


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group