1 回答
TA贡献1845条经验 获得超8个赞
您必须为按钮使用动态选择器(类/id)而不是常量 id #ddgrantType。
尝试这样的事情 -
<?php $dynamic_id = 'ddgrantType_'.$rowInfo['fpID'];?>
<td>Yes<input type="radio" name="rdGrant" value="Yes" id="rdYes" onclick="disable('<?php echo $dynamic_id;?>')" checked="checked"/><br />
No<input type="radio" name="rdGrant" value="No" id="rdNo" onclick="enable('<?php echo $dynamic_id;?>')"/></td>
<form action="classes/functions.class.php" method="POST">
<input type="hidden" name="id" value="<?php echo $fpID; ?>"/>
<td>
//Drop down
<div class="dropdown">
<button class="btn btn-secondary btn-sm dropdown-toggle" type="button" name="ddgrantGroup" id="<?php echo $dynamic_id;?>" data-toggle="dropdown">Select Proper Funding Type
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="ddgrantType">
<li><a data-value="Corporate Sponsor">Corporate Sponsor</a></li>
<li><a data-value="Federal">Federal</a></li>
<li><a data-value="Foundation Selected">Foundation Selected</a></li>
<li><a data-value="Internally Funded">Internally Funded</a></li>
<li><a data-value="State/Local">State/Local</a></li>
</ul>
</div>
</td>
<script>
function disable(btn_id) {
document.getElementById(btn_id).disabled=true;
}
function enable(btn_id) {
document.getElementById(btn_id).disabled=false;
}
</script>
- 1 回答
- 0 关注
- 107 浏览
添加回答
举报