Php 防止用户在填写某些表单后重新打开(单击)按钮
我有一个软件工程的管理信息系统。这就是我想要发生的事情。输入客户基本信息后,其记录(带ID)将显示在客户列表中。旁边是两个按钮,第一个按钮是“合同1”,第二个按钮是“合同2”。在我填写了其中一份合同后,我希望按钮不可点击 (另一种解释) 如果合同为空,请使“按钮”可单击,以便用户可以添加。但当它被填满后,按钮将不再可用 我想你可能需要这个代码Php 防止用户在填写某些表单后重新打开(单击)按钮,php,forms,href,Php,Forms,Href,我有一个软件工程的管理信息系统。这就是我想要发生的事情。输入客户基本信息后,其记录(带ID)将显示在客户列表中。旁边是两个按钮,第一个按钮是“合同1”,第二个按钮是“合同2”。在我填写了其中一份合同后,我希望按钮不可点击 (另一种解释) 如果合同为空,请使“按钮”可单击,以便用户可以添加。但当它被填满后,按钮将不再可用 我想你可能需要这个代码 <?php include 'connect-db.php'; ?>
<?php
include 'connect-db.php';
?>
<table class="myTable" width="80%">
<th width="5%">Customer<br>Number</th>
<th>CRC</th>
<th>Name</th>
<th>Service<br>Contract</th>
<th>Chapel<br>Contract</th>
</tr>
<?php
$sql = "SELECT * FROM records ORDER BY CustomerNumber DESC LIMIT 5";
$result = mysql_query($sql);
if(mysql_num_rows($result) > 0 ){
while($row = mysql_fetch_assoc($result)){
?>
<tr>
<td><?=$row['CustomerNumber']?></td>
<td><?=$row['CRC']?></td>
<td><?=$row['Name']?></td>
<td>
**<a href="editprocess-service.php?CustomerNumber=<?=$row['CustomerNumber']?>">Add</a>
</td>
<td>
<a href="editprocess-chapel.php?CustomerNumber=<?=$row['CustomerNumber']?>">Add</a>
</td>**
</tr>
<?php
}
}
?>
</table>
<br>
<a href="masterlist.php"><input type="button" value="New Record" style="margin-left: 785px;"></a>
客户
号码
华润
名称
服务合同
合同
**
**
粗体的代码是我希望魔法发生的地方。提前谢谢你 如果将合同信息存储在表字段中,则可以使用PHP函数检查是否设置了值
if(isset($row['contract'])) {
//echo disabled button
} else {
//eco interactable button
}
是,只需禁用onclick
<button id="myBtn"onclick="myFunction()">My Button</button>
我的按钮