there is a javascript post problem in my page .... help me..
Posted: Fri Oct 12, 2007 4:49 am
Hello everyone ..
i have a problem ..
i am using javascript validations on my page .. if there is any error on submitting the form fields than this validation shows a warning box which shows the warning with ok button .. the problem is that .. when i press the ok button the page get submitted
and all the false values inserted into the database ...
anybody have any idea what it is going on .... ?/?
the above is the code for all validations when this get false then the message shows there but when i press ok the form get submitted which should not submit .....
i have a problem ..
i am using javascript validations on my page .. if there is any error on submitting the form fields than this validation shows a warning box which shows the warning with ok button .. the problem is that .. when i press the ok button the page get submitted
anybody have any idea what it is going on .... ?/?
Code: Select all
function validation()
{
var error ="\n";
var flag=false;
if(document.from1.title.value=="")
{
flag=true;
error=error +"Please You Must Enter The Subject.\n";
}
if(document.from1.person.value=="")
{
flag=true;
error=error +"Please Enter The responses.\n";
}
if(document.from1.fees.value=="")
{
flag=true;
error=error +"Please Enter The Fees.\n";
}
if(flag==true)
{
alert(error)
return false;
}
else
{
return true;
}
}