Hello to all the community,I'm really brand new....
Pls :
I have a form that post data to a php script by checkboxes.
Iwould like to introduce a button that check all the boxes,but...
1 <head>
2 //here the JS script works fine
3 <head>
4 <body>
5 <form method="post" action="myscript.php">
6 <input type="checkbox" name="sendid[]" value=http://www.webdeveloper.com/forum/archive/index.php/"Jim">
7 <input type="checkbox" name="sendid[]" value="John">
8 <input type="checkbox" name="sendid[]" value="Mary">
9 <input type=button value="Check All" onClick="this.value=check(this.form.sendid[])">
10 <input type="submit" name="send_data" value="data">
11 </form>
Now,the values of checkboxes have to be like
sendid[] because I need to pass an array to my script to be counted() and then imploded(),but if the action of my "Check All" button call the function "check(this.form.sendid[]) i get a syntax error because JS does not like the [] .
Anyway,the JS script run well if I omit the [] but of course in this case the form is not going to pass an array to the PHP script.
Do anybody has idea about the way I can solve this problem??
Thank you very much.
Massimo
Pls :
I have a form that post data to a php script by checkboxes.
Iwould like to introduce a button that check all the boxes,but...
1 <head>
2 //here the JS script works fine
3 <head>
4 <body>
5 <form method="post" action="myscript.php">
6 <input type="checkbox" name="sendid[]" value=http://www.webdeveloper.com/forum/archive/index.php/"Jim">
7 <input type="checkbox" name="sendid[]" value="John">
8 <input type="checkbox" name="sendid[]" value="Mary">
9 <input type=button value="Check All" onClick="this.value=check(this.form.sendid[])">
10 <input type="submit" name="send_data" value="data">
11 </form>
Now,the values of checkboxes have to be like
sendid[] because I need to pass an array to my script to be counted() and then imploded(),but if the action of my "Check All" button call the function "check(this.form.sendid[]) i get a syntax error because JS does not like the [] .
Anyway,the JS script run well if I omit the [] but of course in this case the form is not going to pass an array to the PHP script.
Do anybody has idea about the way I can solve this problem??
Thank you very much.
Massimo