你好任何一个可以帮助我即时无法隐藏第二个或任何其他按钮while循环每当文本框的值小于5然后按钮btn_cart应该禁用bt它不会发生只能在while循环中禁用第一个按钮如果我将任何其他文本框的值更改为小于5 bt我的第一个按钮获取禁用不others.please帮我我卡住无法禁用第二个按钮或任何其他按钮时,点击
function toggle(element) {
if (element.value>'5') {
document.getElementById('btn_cart').style.visibility='visible';
}
else {
document.getElementById('btn_cart').style.visibility='hidden';
alert('Please have Minimum 5 Quantity ')
}
}
<?php include ('dbconnect.php');
$prodetails = mysql_query("Select * from product where category_id='$product_id' ORDER BY product_craetedate DESC ");
while ($fetchprodata = mysql_fetch_array($prodetails))
{
?>
<input type="number" class="item_quantity" value="5" id="" onChange="toggle(this)" />
<?php echo "<input type='button' class='item_add items' name='btn_cart' id='btn_cart' value='ADD'>" ?>
<?php } ?>
提供足够的细节 –
变化'element.value>'5''到'element.value> 5' – shu
喜我的javascript工作我我想禁用它,只要小于5该按钮应该被禁用bt它正在经过while循环,所以只有第一个按钮被禁用nt另一个按钮被禁用becoz它在while循环中,所以请检查n帮助 –