I have created ten textboxes and name them as "txt1,txt2,..tx t10"
(i.e just changing suffix by consecutive number).
Now I have to validate these ten textboxes on Submit event (Say..No textbox should accept alphabet).
I trying to use for loop to validate this i.e. trying to change the suffix of textbox name in each iteration.
[CODE=javascript]for(var i=1;i<=10;i++)
{
if(document.myf orm.txt+i+.valu e==0)
{
alert("Cannot be empty!");
}
}[/CODE]
But this is not working.
So please give me the suitable code for my above requirement.
(i.e just changing suffix by consecutive number).
Now I have to validate these ten textboxes on Submit event (Say..No textbox should accept alphabet).
I trying to use for loop to validate this i.e. trying to change the suffix of textbox name in each iteration.
[CODE=javascript]for(var i=1;i<=10;i++)
{
if(document.myf orm.txt+i+.valu e==0)
{
alert("Cannot be empty!");
}
}[/CODE]
But this is not working.
So please give me the suitable code for my above requirement.
Comment