I have two different js files, namely validate1.js and validate2.js, each have their own function call validate1() and validate2(), then I include them in the header, so it looks like this:
<head><title>input coordinates</title>
<script src = "validate1.js" type="text/javascript"></script>
<script src = "validate2.js" type="text/javascript"></script>
...
and later I use two forms, each calls the different function, as the following:
<FORM METHOD="POST" NAME="DD" ACTION="select.cgi" onsubmit="return validate1(this)">
...
</form>
and
<FORM METHOD="POST" NAME="DMS" ACTION="select.cgi" onsubmit="return validate2(this)" >
...</form>
unfortunately, js only looks for the later file (in this case validate2.js) for both of the function calls, and if I switch the script declaration order in the header, it will look for validate1.js only.
And the interesting part is the same function is being called by both form, (i.e. both form calls validate2() if the validate2.js is loaded last.
wondering what goes wrong here..
Thanks in advance.
<head><title>input coordinates</title>
<script src = "validate1.js" type="text/javascript"></script>
<script src = "validate2.js" type="text/javascript"></script>
...
and later I use two forms, each calls the different function, as the following:
<FORM METHOD="POST" NAME="DD" ACTION="select.cgi" onsubmit="return validate1(this)">
...
</form>
and
<FORM METHOD="POST" NAME="DMS" ACTION="select.cgi" onsubmit="return validate2(this)" >
...</form>
unfortunately, js only looks for the later file (in this case validate2.js) for both of the function calls, and if I switch the script declaration order in the header, it will look for validate1.js only.
And the interesting part is the same function is being called by both form, (i.e. both form calls validate2() if the validate2.js is loaded last.
wondering what goes wrong here..
Thanks in advance.