Are you using JavaScript either to check the validity of the submitted form fields, to handle a form event or to submit the form? Becaue this is not a PHP error: php does not run in the browser.
Ronald
Hi,
Thank you for guiding me on this concept. After reading your reply, I've just begun to understand that if there are any errors in PHP, the parse errors are generated and are displayed.
After reviewing the code, I've been able to avoid the browser error. I'm using JavaScript to check the validity of date fields in the form.
All the functions for checking the validity are defined in the file CheckDate.js
I had used the script tags to include the functions in the current file as
follows:
-
<script language="JavaScript" src="CheckDate.js">
-
</script>
-
The path of the JS source file is also proper.
But later I modified the code by copying all the functions' code from CheckDate.js to the current file and changed the enclosing script tags as follows:
-
<script language="JavaScript" type="text/javascript">
-
# All functions defined in CheckDate.js copied here
-
</script>
-
Both the methods are equivalent and should work fine. But the first method generated browser errors, while the second method worked fine.
What could be the probable reason for this?