表单验证在ie8或ie7中不起作用
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;
}
只是想知道是否有我看不到的明显错误:谢谢你提前提供的帮助。
编辑,因为我分阶段非常糟糕!
我遇到了一个名为submit的提交按钮的问题,它只在IE中失败,而在firefox/chrome中没有,如果你能确保这不是问题所在,那将有所帮助!
或者,更多的信息会有所帮助,因为发布的代码似乎没有任何问题
相关文章:
- Recaptcha在IE7和IE8中不起作用
- 面向对象的Javascript代码在IE7中不起作用
- jQuery函数在IE7中不起作用
- javascript/jquery选项卡在IE7、8或9中不起作用
- 在使用JavaScript的IE7/8中,数组上的.indexOf函数不起作用
- 使用onsubmit函数的Javascript验证在IE8和IE7中不起作用
- 在IE7中,两个函数在window.onload中不起作用
- Posted Flash on Wall (FB.ui js SDK),在IE7/8和Opera中不起作用
- Javascript SDK 在 Facebook Canvas App IE7/8 中不起作用
- .live() 中的 jQuery .select() 在 IE7 和 IE8 上不起作用
- ExCanvas 在 IE7 和 IE8 IFrame 中不起作用
- JQuery 显示/隐藏不起作用的 IE7
- jQuery fancybox 在 IE7 中不起作用
- offset().top 在 IE7 中不起作用
- jQuery Unobposive 在 IE7 或 IE8 中不起作用
- Jquery IE7(:“可见”)验证器不起作用
- j查询数量(输入值)+ / - 按钮在IE7上不起作用
- 为什么使用 insertBefore() 将元素从友好的 iframe 中提取出来在 IE7 中不起作用
- 为什么这个javascript函数在ie7和8上不起作用
- setAttribute 在 IE7 中不起作用