0
我想獲得複選框組的在PHP代碼 jQuery的移動代碼Jquery的移動應用程序的值(我發現樣品例如在此jQuery的移動複選框組此鏈接 http://jsfiddle.net/Palestinian/2yjgg/)得到在PHP代碼Jquery的移動複選框組值
<div data-role="page" id="attend" >
<p>Choose Student who attende:</p>
<div id='group_checkboxes'></div>
<form method="post" action="sign_up3.php" target="_new" >
<script>
$("#attend").live("pageinit",function(event){
var checkboxes = '';
for (i = 0; i <= 5; i++) {
checkboxes += '<input type="checkbox" id="foo' + i + '" class="custom" name="attend_list[]" /><label for="foo' + i + '">Foo checkbox' + i + '</label>';
}
var controlgroup = $("<fieldset/>", {"data-role": "controlgroup"}).append(checkboxes);
$("#group_checkboxes").append(controlgroup.controlgroup());
$("[type=checkbox]").checkboxradio();
$("[data-role=controlgroup]").controlgroup("refresh");
});
</script>
<input type="submit" value="submit" >
</form>
</div>
PHP代碼
<?php
foreach($_POST['attend_list'] as $value)
{
echo $value ;
}
?>
但提交的PHP代碼顯示此錯誤時
「注意:未定義的索引:位於第3行的C:\ xampp \ htdocs \ att \ sign_up3.php中的attend_list
警告:爲C:\ xampp \ htdocs \ att \ sign_up3.php中的foreach在第3行「
我在這個鏈接中找到它 http://jsfiddle.net/Palestinian/2yjgg/ – Beshoy