我想彈出一個MSG和禁用提交按鈕,如果ID =「國家」不等於選項值=「美國」我想我很接近,但似乎無法弄清楚:Popup MSG和禁用提交按鈕
CODE:
<html>
<body>
<script>
$(document).on('change','#Country',function() {
if ((value1 != "US")) {
alert(my error message);
SubmitButton = "disabled";
}
});
</script>
<select id="Country">
<option value="US">United States</option>
<option value="CAN">Canada</option>
<option value="JAP">Jspan</option>
</select>
<br /><br />
<input id="SubmitButton" type="button" value="Submit">
</body>
</html>
是有差異的B/W ATTR和支撐請到通過 – Sunand 2014-09-03 20:06:09
@Sunand,真的不夠,'.prop()'應該用於disabled' – smerny 2014-09-03 20:10:52
'壞我不能回覆單獨的笑臉:) – Sunand 2014-09-03 20:13:36