Hi
Thanks for your post. But it is something weird, when I wrote the code by the name it worked. I have posted the code below.
Code:
unction chall(formObj)
{
alert("formObj here");
chob = document.getElementsByName("input[]");
alert("formObj here1");
for (i=0; i<chob.length; i++)
{
alert("inside formObj here");
if (chob[i].value == "")
{
alert("Input item on Row #"+(i+1)+" has been left empty. Please make sure you input something into this field.");
return false;
}
}
But when I change the code and write it by ID, it does not work. any ideas or suggestions.
Code:
function chall(formObj)
{
alert("formObj here");
alert("formObj here");
chob = document.getElementsById("input[]");
alert("formObj here1");
for (i=0; i<chob.length; i++)
{
alert("inside formObj here");
if (chob[i].value == "")
{
alert("Input item on Row #"+(i+1)+" has been left empty. Please make sure you input something into this field.");
return false;
}
}
Bookmarks