求教:form value.length 问题:
来源:百度知道 编辑:UC知道 时间:2024/06/30 11:35:09
function validateform2()
{
if(!document.all.no.value)
document.all.no.value=1;
for(i=1;i<=1;i++)
{
if (form2.url'+i+'.value.length!=0){
if(form2.ly1.options[form2.ly1.selectedIndex].value.length==0)
{
str1="数据"+i+"不能为空"
alert(str1)
return false
}
return true
}
}
}
请问 form2.url'+i+'.value.length!=0 中的url'+i+' 怎么写?
FOR 不是执行一次,为了测试我改成了一次
谢谢各位!
{
if(!document.all.no.value)
document.all.no.value=1;
for(i=1;i<=1;i++)
{
if (form2.url'+i+'.value.length!=0){
if(form2.ly1.options[form2.ly1.selectedIndex].value.length==0)
{
str1="数据"+i+"不能为空"
alert(str1)
return false
}
return true
}
}
}
请问 form2.url'+i+'.value.length!=0 中的url'+i+' 怎么写?
FOR 不是执行一次,为了测试我改成了一次
谢谢各位!
for(i=1;i<=1;i++)
{
//用ID命名
var temp = document.getElementById('url'+i);
if (temp.value.length!=0){
//if (form2.url'+i+'.value.length!=0){
if(form2.ly1.options[form2.ly1.selectedIndex].value.length==0)
{
......
前面先把URL得到,然后+i得到一个新的URL后再判断就可以了
for(i=1;i<=1;i++)
{
if (form2.url'+i+'.value.length!=0){
if(form2.ly1.options[form2.ly1.selectedIndex].value.length==0)
{
你写的太多余了吧.for循环就执行一次你还不如就直接写
form2.url1.value.length!=0
得了.
真服你了...太强了.
document.form.id.value的用法
form下input中的value的作用?
求教`Right form the beginning是什么意思`
C++中出现left operand must be l-value错误
★☆☆ JS中 document.form.input[i].value=""; 不合法? 在线等!
sql="select * from 表名 where 字段名=' "& document.Form.Select.value" ' "
error C2106: '=' : left operand must be l-value
l两台电脑互连问题求教
short form, third party, LASII and B/L evidencing shipment on deck are not acceptable
信用证中short form/blank back B/L is not acceptable.什么意思