How do I add JavaScript??

Abu_sufi 17 Sep, 2011
How do I add JavaScript to my form? I'm using joomla 1.6 and v4.
GreyHead 18 Sep, 2011
Hi abi_sufi,

Drag a Load JS action into the On Load event.

Bob
Abu_sufi 19 Sep, 2011
ty for replying back.

would it be possible to put a link to the JavaScript file in the head section of the form?
GreyHead 19 Sep, 2011
Hi abu_sufi,

If you have a JavaScript file you can add it to the page header with
<?php
$doc =& JFactory::getDocument();
$doc->addScript('full_file_url_goes_here');
?>


Bob
Abu_sufi 12 Oct, 2011
how do i get to the header section of the form?
GreyHead 12 Oct, 2011
Hi abu_sufi ,

You can add the PHP snippet in a Custom Code action in the On Load before the Show HTML action (jn CFv4) or in the Form HTML box (in CFv3).

Bob
Abu_sufi 14 Oct, 2011
Thank you for you're respond but I'm having no luck 😶

I've added Custom Code before the show html, placed the 2 JavaScript files inside ...components/com_chronoforms/js folder.

linked the 2 files inside custom code and can't get it to work. Is there any simple tutorial I could follow that will show me how to add JavaScript files?

Kind Regards.
GreyHead 21 Oct, 2011
Hi abu_sufi,

What code have you put in the Custom Code box?

Bob

PS Sorry, I can't do this for you, just too busy at the moment.
This topic is locked and no more replies can be posted.