javascript - JS/PHP checkbox name -
i have question this:
function addnamecheckbox(name) { var html = "<div class='checkboxblock'><label for='check_" + name + "'>" + name + ":</label><input type='checkbox' name='check_" + name + "' id='check_" + name + "' class='stuff' /></div>"; $("#namecheckboxcontainer").append(html); } adds checkbox when clicking instead of name=' " name" ' blabla want values $ploegnaam[] can fetch them post how that?
the output of name= names fetched ajax post.
i want simple $ploegnaam[] althou google'd , tried didnt work out.
you can append square brackets name, if want retrieve values array in php:
<input name="foo[]" type="text" value="input1" /> <input name="foo[]" type="text" value="input2" /> and in php:
<?php print_r($_request['foo']); ?> it returns array:
array( 0 => 'input1', 1 => 'input2' )
Comments
Post a Comment