enter code here
我有一个包含许多字段的表格。我需要的是默认情况下禁用底部名称为“Shipping Preference”的下拉菜单,直到填写 2 个或更多项目表单字段。所以填写了 2 个文本字段,下拉菜单将是启用。怎么做?我一点想法都没有。任何帮助将不胜感激。另请注意:我对字段和占位符有限制。这是代码:
<SCRIPT> $("#Glass_ASTRO_165WNT").on('change', function() {
this.value = (!Number(this.value)) ? '' : Math.max(100, Math.min(999999, Number(this.value)));
});
//With reference to http://www.hagenburger.net/BLOG/HTML5-Input-Placeholder-Fix-With-jQuery.html
// 1. Handle placeholders (in non-HTML5 compliant browsers).
if(!supports_input_placeholder()) {
$('[placeholder]').focus(function () {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function () {
var input = $(this);
if (input.val() == '' || input.val() == input.attr('placeholder')) {
input.addClass('placeholder');
input.val(input.attr('placeholder'));
}
}).blur();
//2. Prevent placeholder values being submitted to form's action script
$('[placeholder]').eq(0).closest('form').submit(function () {
$(this).find('[placeholder]').each(function () {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
}
});
});
}
});</SCRIPT>
<form name="amada" method="post" action="review.php"onSubmit="return validate.check(this)">
<div class="side1">
<article>
<h2>Silver Name Badges</h2>
<p class="subDetails">Min. Qty: 100 pcs <br>
Lead Time: 3 Weeks<br>
<img src="web-pics/name_badge.png" width="200" height="200" alt="badge" /><br>
Quantity:
<input type="text" default=min=100 placeholder="none" name="Silver_Name_Badges" id="Silver_Name_Badges" maxlength="10" style="width:50px" tabindex=1 >
</p>
</article>
<td valign="top"><select name="Ship_Preference" id="Ship_Preference" tabindex=20 >
<option value="Partial Shipment">Partial Shipment</option>
<option value="When All Items Ready">Ship When All Items Ready</option>
</select></td>
<td valign="top"><select name="Ship_Preference" id="Ship_Preference" tabindex=20 >
<option value="Partial Shipment">Partial Shipment</option>
<option value="When All Items Ready">Ship When All Items Ready</option>
</select></td>