RE: Using External Javascript in CForms
> -Original Message- > From: Robin Wyles [mailto:[EMAIL PROTECTED] > > You can add a reference to the JS file containing your formatDate > function in the sitemap... > > > > > > ... or you could include it in one of your existing flowscript files > like this ... Really should have thought of adding the Javascript to my sitemap. Worked a treat. Thanks, Gary -- * The information contained in this message may be confidential or legally privileged and is intended for the addressee only, If you have received this message in error or there are any problems, please notify the originator immediately. The unauthorised use, disclosure, copying or alteration of this message is strictly forbidden. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using External Javascript in CForms
Gary, You can add a reference to the JS file containing your formatDate function in the sitemap... ... or you could include it in one of your existing flowscript files like this ... cocoon.load("flow/date_utils.js"); The advantage I see to declaring it in the sitemap is that your JS file will be automatically updated when it changes, whereas if you include it in another JS file you have to touch the parent file before updates to the included file take effect. Robin On 13 Feb 2006, at 12:38, Stewart, Gary wrote: Hi there, I've been trying to use an external Javascript in an on-value- changed in a form field def. I have something like: event.source.value = formatDate(event.source.value); and I include the function in one of the stylesheets. I get a org.mozilla.javascript.EcmaError: "formatDate" is not defined; which is quite right as it hasn't been defined at that stage. I looked through the samples but I couldn't see anywhere were an external Javascript was included for this purpose. Can this be done or should all scripting be performed inline? Thanks, Gary * The information contained in this message may be confidential or legally privileged and is intended for the addressee only, If you have received this message in error or there are any problems, please notify the originator immediately. The unauthorised use, disclosure, copying or alteration of this message is strictly forbidden. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using External Javascript in CForms
Hi there, I've been trying to use an external Javascript in an on-value-changed in a form field def. I have something like: event.source.value = formatDate(event.source.value); and I include the function in one of the stylesheets. I get a org.mozilla.javascript.EcmaError: "formatDate" is not defined; which is quite right as it hasn't been defined at that stage. I looked through the samples but I couldn't see anywhere were an external Javascript was included for this purpose. Can this be done or should all scripting be performed inline? Thanks, Gary * The information contained in this message may be confidential or legally privileged and is intended for the addressee only, If you have received this message in error or there are any problems, please notify the originator immediately. The unauthorised use, disclosure, copying or alteration of this message is strictly forbidden. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]