簡體   English   中英

表單驗證在ie8或7中不起作用

[英]Form validation not working in ie8 or 7

嗨,基本上我似乎無法使表單驗證在ie8或更低版本的表單上工作。 它在其他任何地方都可以正常工作。

基本上遵循以下原則:

function validateform() {
    if (document.getElementById('firstinput').value == '') {
        alert("Select start Date");
        document.getElementById('firstinput').focus();
        return false;
    }
    if (document.getElementById('secondinput').value == '') {
        alert("Select end Date");
        document.getElementById('secondinput').focus();
        return false;
    }
    if (document.getElementById('restriction').checked == false) {
        alert('Please select I have read and understand the above restrictions.');
        return false;
    }
    if (document.getElementById('termscondition').checked == false) {
        alert('Please select terms and condition..');
        return false;
    }
    if (document.getElementById('letters_code').value == '') {
        alert("Enter captcha code..");
        document.getElementById('letters_code').focus();
        return false;
    }
    return true;
}​

只是想知道是否有任何我看不到的明顯錯誤:s感謝您的任何提前幫助。

正在編輯,因為我分階段地完成了該任務!

我遇到了一個涉及名為提交的提交按鈕的問題,該問題僅在IE中失敗,而在firefox / chrome中失敗,如果可以確保這不是問題,那將會有所幫助!

另外,更多信息可能會有所幫助,因為發布的代碼似乎沒有任何錯誤

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM