muddunazar
Programmer
I am trying to write a function that is being invoked when some one clicks the submit button on the form.
<form name="sectionA" action="optionpage.cfm" onSubmit="return abc()">
I have three tables with initials textboxes. I want to check if they are empty and return false(stay on the same page), else go to action page.
Here is what I am doing, I Created three functions tableA(), tableB(),tableC() call them from function abc(). These functions tableA(), tableB(), tableC() return false if one of the field is empty and stop furthur processing and remain in the same page. If none(errors), then go the other page.
i.e if table B has empty fields, page should stop furthur processing and remain in the same page.
Here is how I am doing it
Can somebody please point out what I am doing wrong here.
Even when there is empty field, the code moves me to the actionPage.
function abc()
{
tableA();
tableB();
tableC();
return true;
}
function tableA()
{
if(""=document.formName.tableAinitial.value)
return false;
}else{
return;
}
}
function tableB()
{
if(""=document.formName.tableBinitial.value)
return false;
}else{
return;
}
}
function tableC()
{
if(""=document.formName.tableCinitial.value)
return false;
}else{
return;
}
}
<form name="sectionA" action="optionpage.cfm" onSubmit="return abc()">
I have three tables with initials textboxes. I want to check if they are empty and return false(stay on the same page), else go to action page.
Here is what I am doing, I Created three functions tableA(), tableB(),tableC() call them from function abc(). These functions tableA(), tableB(), tableC() return false if one of the field is empty and stop furthur processing and remain in the same page. If none(errors), then go the other page.
i.e if table B has empty fields, page should stop furthur processing and remain in the same page.
Here is how I am doing it
Can somebody please point out what I am doing wrong here.
Even when there is empty field, the code moves me to the actionPage.
function abc()
{
tableA();
tableB();
tableC();
return true;
}
function tableA()
{
if(""=document.formName.tableAinitial.value)
return false;
}else{
return;
}
}
function tableB()
{
if(""=document.formName.tableBinitial.value)
return false;
}else{
return;
}
}
function tableC()
{
if(""=document.formName.tableCinitial.value)
return false;
}else{
return;
}
}