function frmCheck(){
with(document.frmAdd){
window.event.returnValue=false;
if(CNStrLen(subject.value)>400||subject.value==""){
alert("问题内容必填且不能超过400字节");
subject.focus();
}
else if(document.all("questionoption").innerHTML!=""){
for (i=0;i<context.length;i++){
if(CNStrLen(context[i].value)>100||context[i].value==""){
alert("第"+parseInt(i+1)+"个选项必填且不能超过100字节");
context[i].focus();
break;
}
}
if(i==context.length-1) submit();
}else{
window.event.returnValue=true;
}
}
}
with(document.frmAdd){
window.event.returnValue=false;
if(CNStrLen(subject.value)>400||subject.value==""){
alert("问题内容必填且不能超过400字节");
subject.focus();
}
else if(document.all("questionoption").innerHTML!=""){
for (i=0;i<context.length;i++){
if(CNStrLen(context[i].value)>100||context[i].value==""){
alert("第"+parseInt(i+1)+"个选项必填且不能超过100字节");
context[i].focus();
break;
}
}
if(i==context.length-1) submit();
}else{
window.event.returnValue=true;
}
}
}
解决方案 »
- 新手 ~需高人指点
- 紧急求证,有没有getElementByTagName这个函数? (没有那个s)
- 问一个最基本的正则表达式?
- 我能把一个图标放在一个点上,如果有几个图标,分别放在不同的点上,几十个左右,该怎么办,多谢了
- 求页面中获取框架对象的代码
- 高分求客户端tree代码
- csdn的树型菜单隐藏功能怎么实现
- A中点击按扭打开一个页面B,把B中的东西,回传给A中的文本框,并同时关闭B,怎么实现?????????
- 这样的要赤求可否实现?高分求代码(100分)
- jq ztree,怎么根据给定的节点字符串,默认选中
- xmlhttp发请求ie报没有权限
- 请问表单中file对象的“浏览”按钮的外观有办法改变吗?
========================================================
function frmCheck(){
with(document.frmAdd){
window.event.returnValue=false;
if(CNStrLen(subject.value)>400||subject.value==""){
alert("问题内容必填且不能超过400字节");
subject.focus();
return false;
}
else if(document.all("questionoption").innerHTML!=""){
for (var i=0;i<context.length;i++){
if(CNStrLen(context[i].value)>100 || context[i].value==""){
alert("第"+parseInt(i+1)+"个选项必填且不能超过100字节");
context[i].focus();
return false;
}
}
submit();
}else{
window.event.returnValue=true;
return true;
}
}
}
else if()
{
for(){}
}
else if()
{
for(){}
}
else if(){}
else{}
check()
..........
return true ;