Gossamer Forum
Home : Products : DBMan : Customization :

help please - javascript

Quote Reply
help please - javascript
hi -

i am inserting a javascript calendar into dbman. the one problem i am having is that in the javascript i need to use || in a if statement which means this OR this. Dbman gives me an error because of ||. Does anybody have any suggestions.

Thanks!
Quote Reply
Re: [msavi] help please - javascript In reply to
1. With perl (dbman) you are better off having your javascript in an "external" file. This prevents any problems you may encounter with brackets etc.

At the top of your page include this:

<SCRIPT LANGUAGE="JavaScript" SRC="http://www.mydomain.com/bob.js"></SCRIPT>

Then stick all of your JavaScript into a file called bob.js (no need to have the <SCRIPT> tags in the bob.js file too).

Then it should work okay.

2. Another alternative would be to change your print function to print qq~ do javascript stuff ~; (look at the footer subroutine to see what I mean - notice how it is different than the rest of the "print qq|" stuff?

3. Another another alternative would be to try using the word "OR" instead of "||" and see if it still works.

My main solution is to use example #1. It really keeps my stuff nice and tidy.
Quote Reply
Re: [Watts] help please - javascript In reply to
Thank you!

Solution #1 - inserting into an external file worked great. One more question - in the html.pl I call the javascript inside a form. I thought I can embed a form inside a form:

<form action= ...>
<input.....
<form action =...
<input ...

</form>
</form>

I need the second form to implement the javascript. It does not work.
Any suggestions?

Thanks!