javascript中如何传递变量?? if (document.form1.elements[arg].value.substring(0,1)=="0") 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我用孟子E章的方法试了,但是出错:提示“'document.form1.elements[....].value'为空或不是对象“ 好了,贴上来大家欣析一下用onblur="testprice('image_width');"调用function testprice(arg){ /*if (document.form.price.value.indexOf("0") > -1) { */var s = document.getElementById(arg);if (s.value.substring(0,1) == "0" ) {alert("不能用0开头");s.focus();return false; } else { return true; } } 还有一种方法:onBlur="return testprice('image_width');"function testprice(arg){ if (document.form1.elements[arg].value.substring(0,1)=="0"){alert("数据有误!");document.form1.elements[arg].focus();return false; } else{ return true; } } jsp怎么调用js返回值 框架(top、main、bottom),main中(left、right),right如何返回登录页面 问一个正则的问题 showdialog js 怎样传递一个数组到另一个js checkbox状态 如何在一个页面载入时调用一个servlet? 如何在程序中弹出一个窗口,如果开着,就不打开,如果不开,就打开。 用javascript 控制声音播放,但是窗口最大话时居然也有声音! 判断日期类型的问题 求提交页面时出现“没有权限”提示的解决 /////请问:下拉列表的问题\\\\\
提示“'document.form1.elements[....].value'为空或不是对象“
/*if (document.form.price.value.indexOf("0") > -1) { */var s = document.getElementById(arg);
if (s.value.substring(0,1) == "0" )
{
alert("不能用0开头");
s.focus();
return false;
}
else {
return true;
}
}
onBlur="return testprice('image_width');"function testprice(arg)
{
if (document.form1.elements[arg].value.substring(0,1)=="0")
{
alert("数据有误!");
document.form1.elements[arg].focus();
return false;
}
else
{
return true;
}
}