Forums

Adding some JS to my contact form

BrettVorster 26 Jul, 2012
Hi Guys,

Please help me, how do I add this:

<script type="text/javascript">llfrmid=22103</script>
<script type="text/javascript" src="http://formalyzer.com/formalyze_init.js"></script>
<script type="text/javascript" src="http://formalyzer.com/formalyze_call.js"></script>

to my contact form?

Thank you
Brett
BrettVorster 30 Jul, 2012
Hiya Bob,

So from what I read, is this how I would do it?

window.addEvent('domready', function() {
<script type="text/javascript">llfrmid=22103</script>
<script type="text/javascript" src="http://formalyzer.com/formalyze_init.js"></script>
<script type="text/javascript" src="http://formalyzer.com/formalyze_call.js"></script>
});
GreyHead 30 Jul, 2012
Hi Brett,

Nope :-(

You don't want script tags inside your JavaScript. In a Load JS action add this code:
var llfrmid = 22103;
<?php
$doc =& JFactory::getDocument();
$doc->addScript('http://formalyzer.com/formalyze_init.js');
$doc->addScript('http://formalyzer.com/formalyze_call.js');
?>

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