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.
var filePath = document.getElementsByName("fileSelect");
if (filePath == '')
<form action="process.php" method="post" onSubmit="return eCheck();">
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.
<form action="process.php" method="post" onSubmit="errorPath(); return false;">
but i want it to run the error check. Any ideas on way it's not working.
Thanks in Advance.