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.
Expand|Select|Wrap|Line Numbers
- function eCheck()
- {
- var filePath = document.getElementsByName("fileSelect");
- if (filePath == '')
- {
- errorPath();
- return false;
- }
- return true;
- }
Expand|Select|Wrap|Line Numbers
- <form action="process.php" method="post" onSubmit="return eCheck();">
but when i do the following, errorPath(); works and form submit is called off.
Expand|Select|Wrap|Line Numbers
- <form action="process.php" method="post" onSubmit="errorPath(); return false;">
Thanks in Advance.