dougcranston
Technical User
Hope someone can point me to a logical answer and solution.
I had built client-side validation and had embedded in <script></script> tags located in the <head> of my page and it worked fine.
I then moved some business rules that controlled checkboxes and stuff to an external .js file. Continued testing and that worked fine.
Then I moved my validation code from the internal/embedded to a separate .js file, reference in my page looked like:
<SCRIPT
type="text/javascript"
language="JavaScript"
src="includes/vldprcrqst.js"></SCRIPT>
However, then my validation stopped working. Would not even call it. (Added an alert as the first line of the validation function.. nothing.) Just bypassed it totally and tried to send the data on to my ASP page which REALLY did not like it..
Put the validation code back in its original spot embedded in the <head> of my page and it works fine.
A portion of the calling onSubmit is as follows:
<FORM name="frmInput" action="crft.asp" method="post"
onSubmit="return validcheks(reqType.value, ItemID.value, ......
Had wanted to keep the web page, a .htm just HTML code, and move the .js, and .css to external files, but this one has been plaguing me the past day, and I was bound and determined NOT to move the validation code back.
In the final analysis I can keep it embedded, but it feeling right to have the rules, validation and css external to the HTML page, since this is huge as one file. This is not the way I want to do it. However, it is an intranet app, and will be used only by a select # of users to input new products to be added to our point of sale system. Bandwidth and CPU time on the staff PC's is not as much of an issue.
I would post the code, but at the moment it is over 140K, which breaks out:
42k html (sans validation)
23k validation.js
53k business rules.js
7k stylesheet .css
22k calendar.js
I have checked this site relative to external includes and validation, but nothing close. Have searched google, and my reference books, both HTML and Javascript and no hints or ideas.
Any suggestions would be appreciated.
Thanks inadvance.
DougCranston
I had built client-side validation and had embedded in <script></script> tags located in the <head> of my page and it worked fine.
I then moved some business rules that controlled checkboxes and stuff to an external .js file. Continued testing and that worked fine.
Then I moved my validation code from the internal/embedded to a separate .js file, reference in my page looked like:
<SCRIPT
type="text/javascript"
language="JavaScript"
src="includes/vldprcrqst.js"></SCRIPT>
However, then my validation stopped working. Would not even call it. (Added an alert as the first line of the validation function.. nothing.) Just bypassed it totally and tried to send the data on to my ASP page which REALLY did not like it..
Put the validation code back in its original spot embedded in the <head> of my page and it works fine.
A portion of the calling onSubmit is as follows:
<FORM name="frmInput" action="crft.asp" method="post"
onSubmit="return validcheks(reqType.value, ItemID.value, ......
Had wanted to keep the web page, a .htm just HTML code, and move the .js, and .css to external files, but this one has been plaguing me the past day, and I was bound and determined NOT to move the validation code back.
In the final analysis I can keep it embedded, but it feeling right to have the rules, validation and css external to the HTML page, since this is huge as one file. This is not the way I want to do it. However, it is an intranet app, and will be used only by a select # of users to input new products to be added to our point of sale system. Bandwidth and CPU time on the staff PC's is not as much of an issue.
I would post the code, but at the moment it is over 140K, which breaks out:
42k html (sans validation)
23k validation.js
53k business rules.js
7k stylesheet .css
22k calendar.js
I have checked this site relative to external includes and validation, but nothing close. Have searched google, and my reference books, both HTML and Javascript and no hints or ideas.
Any suggestions would be appreciated.
Thanks inadvance.
DougCranston