How to attach Javascript file

schel4ok 31 May, 2010
Hi,

could you tell me how to attach Javascript files to the form?
because it is much comfortable to edit code in text editor rather than in small textbox in ChronoForms cpanel.
GreyHead 31 May, 2010
Hi schel4ok,

Add this code to the Form HTML (I use an 'includes/form_name' folder for these files but you can change the url to something different if you like).
<?php
if  ( !$mainframe->isSite() ) {return;}
$doc =& JFactory::getDocument();
$doc->addScript(JURI::base().'components/com_/chronocontact/includes/form_name/javascript.js');
?>

Bob
This topic is locked and no more replies can be posted.