我试图在php中使一个循环工作,可悲的是,它没有执行它必须做的事情,它相当循环了数组等,但是当我单击按钮时,什么也没发生。只有第一个按钮有效。
它在这里:
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
到目前为止JS ^ nog php。没有发布完整的代码。因为它的时间很长,但是从这里开始,至此完全可以正常工作。
echo "<table>
<thead>
<tr>
<td>Name</td>
<td>Last Name</td>
<td>Email</td>
<td>Extension</td>
<td>Numbers</td>
<td>Datum</td>
</tr>";
foreach ($response as $key => $value) {
echo "
<tr>
<td>".$value['fname']."</td>
<td>".$value['lname']."</td>
<td>".$value['email']."</td>
<td>".$value['ext']."</td>
";
foreach ($value['numbers'] as $key2 => $numvalue) {
echo"<td>".$numvalue."</td>";
}
echo "<td>";
echo("<form action='<?php echo" . $_SERVER['PHP_SELF'] . "?>' method='post'> <input type='button' name='button' id='datepicker' value='Get call history'></form>");
echo "</td>";
}
echo "
</tr>
</thead>
</table> ";
我想这里有一个问题:
echo("<form action='<?php echo" . $_SERVER['PHP_SELF'] . "?>' method='post'> <input type='button' name='button' id='datepicker' value='Get call history'></form>");
抱歉,很长的代码..
毕竟,我找到了正确的答案,确实必须将其更改为全班,这要感谢汤姆·哈特(Tom Hart)
$(function() {
$(".datepick2").datepicker({'dateFormat': 'd/m/y'});
});
</script>
和形式
echo("<form action='" . $_SERVER['PHP_SELF'] . ">' method='post'> <input type='button' name='button' class='datepick2' value='Get call history'></form>");
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句