General discussion

Locked

validation check of table in asp

By Arati ·
Hello programers!

I have created table in asp by using loop it working nicely.

but while doing validation,
1. the loop created in javascript for validation is checking the first row of table & then it comes out from the loop

2. the loop is checking the textbox and gives the message also but does not focus that text box it goes to the other textbox of the row.

email me for table code if required.(due to limit of max.len

<script>
function isempty(t)
{
if(t.value == "")
return true;
else
return false;
}
function checkIschar(z)
{
if (isNaN(z.value)== true)
return 'y';
else
return 'n';
}
function checkfields(f,b)
var ff,element1,element2,element3,element4,element5,element6;
for(ff = 1;ff >= f ; ff++);
{
element1 = eval('document.f1.name'+ ff);
element2 = eval('document.f1.age' + ff);
element3 = eval('document.f1.cmb' + ff);
element4 = eval('document.f1.workingfield' + ff);

if (isempty(element1)==true)
{
element1.focus()
}
else if(checkIschar(element1) == 'n')
{
element1.focus()}
else if (isempty(element2)==true)
{
element2.focus()
}
else if(checkIschar(element2) == 'y')
{
element2.focus()
}

else if (element3.selectedIndex==0)
{
element3.focus();
}
else if (element3.selectedIndex==2)
{
if (isempty(element4)==true)
element4.focus()
if(checkIschar(element4) == 'n')
{
element4.focus()
}
}
else if (ff ==> f)
document.f1.submit();
}
}
</script>
Thanks

This conversation is currently closed to new comments.

11 total posts (Page 2 of 2)   Prev   01 | 02
Thread display: Collapse - | Expand +

All Comments

Back to Web Development Forum
11 total posts (Page 2 of 2)   Prev   01 | 02

Related Discussions

Related Forums