and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
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 .... ?/?
[syntax="javascript"]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;
}
}
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 .....
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
yes i am using the same thing on form .....
see this function
[syntax="javascript"]
function verify()
{
var str;
str=confirm("Are you really want to delete skills ?");
if(str==true)
return true;
else
return false;
}
and i am calling this function on form submit like this...[/syntax]
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]