hello,
i want to check for errors on submitting a form, on encountering an error it runs a function and returns a false preventing form submit. I have implemented that.
[CODE="javascrip t"]
function eCheck()
{
var filePath = document.getEle mentsByName("fi leSelect");
if (filePath == '')
{
errorPath();
return false;
}
return true;
}
[/CODE]
[CODE="HTML"]
<form action="process .php" method="post" onSubmit="retur n eCheck();">
[/CODE]
When i do the above, it isn't going through the check or rather not running the function errorPath(); and returning the value as false.
but when i do the following, errorPath(); works and form submit is called off.
[CODE="HTML"]
<form action="process .php" method="post" onSubmit="error Path(); return false;">
[/CODE]
but i want it to run the error check. Any ideas on way it's not working.
Thanks in Advance.
i want to check for errors on submitting a form, on encountering an error it runs a function and returns a false preventing form submit. I have implemented that.
[CODE="javascrip t"]
function eCheck()
{
var filePath = document.getEle mentsByName("fi leSelect");
if (filePath == '')
{
errorPath();
return false;
}
return true;
}
[/CODE]
[CODE="HTML"]
<form action="process .php" method="post" onSubmit="retur n eCheck();">
[/CODE]
When i do the above, it isn't going through the check or rather not running the function errorPath(); and returning the value as false.
but when i do the following, errorPath(); works and form submit is called off.
[CODE="HTML"]
<form action="process .php" method="post" onSubmit="error Path(); return false;">
[/CODE]
but i want it to run the error check. Any ideas on way it's not working.
Thanks in Advance.
Comment