Re: [PHP] checkboxes problem
- From: ceo@xxxxxxxxx ("Richard Lynch")
- Date: Wed, 30 May 2007 13:06:13 -0500 (CDT)
On Wed, May 30, 2007 3:59 am, blueboy wrote:
Hi,
I have a checkbox array (about 20 lines)
input name=\"box\" type=\"checkbox\" value=\"$id\">
input name=\"box\" type=\"checkbox\" value=\"$id\">
input name=\"box\" type=\"checkbox\" value=\"$id\">
I do some client side checking with javascript however the javascript
array
name=\"box\"
does not match the php version,
name=\"box[]\"
So either my client side stuff works or the php array only returns 1
value
when posted. Is there any way to for this to work?
Let PHP use the NAME= attribute, and JS use the ID= attribute
name="box[1]" id="box1"
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
.
Relevant Pages
- Re: [PHP] What sripts,helpers to use for AJAX
... You might want to check the YUI for other goodies as well. ... It only deals with client-side Javascript which lets you handle the sever side pretty much whichever way you want it so you are not forced to buy into a whole framework, client and server side, when you don't really need that much. ... Unless you have good reasons to serve data in XML format, to keep life simple, I would also sugest you use JSON, which is easy to generate (recent PHP versions have json_encode() and json_decode) and is native JavaScript. ... (php.general) - Re: Which Is The Better Approach To Working With Javascript?
... However this is achieved, PHP has no script interface, ... Javascript is run **ONLY** on the client. ... but I think the original answers based on the level of the OP were probably good ones; run it client side because the server likely doesn't provide it?. ... (comp.lang.php) - Very Strange problem with my AJAX code
... The php routine that is called interrogates the database, cereates an array and then uses that array to build the message that is sent back to the receiving javascript code. ... (comp.lang.php) - Re: [PHP] Array maybe? Or many SQL insert queries
... You can attach a javascript function to the onclick event of the Add ... have a predefined array of all possible values that the ... If you are not a big fan of javascript + DOM (this is, after all, a PHP ... appending the value of the entered box to the array. ... (php.general) - Re: sending an array from php to javascript
... when they submit the form there is a javascript formvalidation. ... the fly) i collect all the form fieldnames in an php array and sent it to ... $velden is the name of the array with the form fieldnames. ... I have not tested the above snippet. ... (comp.lang.javascript) |
|