當我將隱藏值傳遞給php文件時,它將(true)1作爲答案。無法將隱藏表單值傳遞給php
我將模態值傳遞給php文件。
跨度值是使用jquery檢索的。
PHP代碼:
<?php
include "dbcon.php";
if(isset($_POST['pd_del']))
{
echo mysql_error();
$delid=isset($_POST['delidd']);
echo $delid;
}else
{
echo mysql_error();
}
?>
HTML代碼:
形式多數民衆贊成派的產品ID到PHP文件
<form name="prd_del" action="del_prod.php" method="post">
<div class="modal fade" id="delModal" tabindex="-1" role="dialog" aria-labelledby="delModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">DELETE PRODUCT</h4>
</div>
<div class="modal-body">
<h5>Do you want to Delete this Product ??? <span id="delid" name="delid"></span></h5>
<input type="hidden" name="delidd" id="delid">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" name="pd_del" >Delete It!</button>
</div>
</div>
</div>
</div>
</form>
你有'ID =「delid」'多個元素 – marekful
你沒有(價值=「中(<輸入型我的價值)=」隱藏的「name =」delidd「id =」delid「>)。你也重複了span中的id() – Tasos
那麼我怎樣才能將span值傳遞給php文件 – user3857836