這與mint.com confimration風格類似。
將JavaScript添加到文本框onChange
或onKeyUp
事件,那裏做你的檢查並啓用按鈕。
例如:
<script type="text/javascript">
function checkConfirmationText(){
// Check if value of entered text = value of hidden text
var isOk = document.getElementById('confirmation-label').value == document.getElementById('confirmation-text').value);
// Show/Hide button depending on the text
document.getElementById('btn-submit').style.dispaly = isOk ? '' : 'none';
}
</script>
<!-- HTML -->
<input type="hidden" id="confirmation-label" value="DELETE" />
Enter "DELETE": <input type="text" id="confirmation-text" value="" onkeyup="checkConfirmationText()" />
<input type="submit" id="btn-submit" style="display:none" />
聽起來像一個CAPTCHA.There任何理由不使用它? – 2010-09-23 14:29:58