To value of textbox named txt1,txt2 upto txt10.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   amit_thakur
Posted On:   Sunday, November 7, 2004 02:50 AM

New Document function ClickMe() { alert("1"); var i; var S=document.a1; for(i=1;i { alert(i); alert(document.a1.txt"+i+".value); ///alert(document.a1.txt["+i+"].value); ///alert(document.a1.txt['+i+'].value); alert(document.a1.txt[i].value); } } ]]>]]> Hello Friends, i have one problem in javascript. I have 10 textbox anf its name is as followes. txtItem1,txtItem2 upto txtItem10. now i want to run a "for" loop which will check whether textbox is filled or not. i tried it not able to solve. i tried like this. (i writing code ) Its giving error "document.a1.txt.+i+ in null or not an object" So suggest me how to solve this one. //////////   More>>
New Document
			
Hello Friends,
i have one problem in javascript.
I have 10 textbox anf its name is as followes.
txtItem1,txtItem2 upto txtItem10.

now i want to run a "for" loop which will check whether textbox is filled or not.
i tried it not able to solve.
i tried like this. (i writing code ) Its giving error "document.a1.txt.+i+ in null or not an object"
So suggest me how to solve this one.

///////////////////////Code /////////////////////////////
































//////////////////////End Code///////////////////////////


From
Amit    <<Less

Re: To value of textbox named txt1,txt2 upto txt10.

Posted By:   Firat_Tiryaki  
Posted On:   Friday, November 19, 2004 01:21 AM

you should eval the text to make it work in all browsers




function ClickMe()
{
for(i=1;i<=5;i++)
{
myText=eval("document.a1.txt"+i);
alert(myText.value);
}
}

About | Sitemap | Contact