NOTICE: RocketTheme will be releasing templates for Joomla! 1.5 only starting January 2009. Read the thread…
RocketTheme  |  General  |  The Water Cooler  |  Topic: How can I embed a javascript form inside content? (template breaks) « previous next »
Pages: [1] Go Down Print
Author Topic: How can I embed a javascript form inside content? (template breaks)  (Read 1015 times)
Adam Parker
Sr. Rocketeer
****
Offline Offline

Posts: 101


How can I embed a javascript form inside content? (template breaks)
« on: April 13, 2008, 11:40:13 AM »

I embedded this example form from Extjs javascript library:
http://extjs.com/deploy/dev/examples/form/dynamic.html

I copied code and fixed the paths and copied code into a static content page located here - see how the javascript forms are all outside of the template:
http://emrgrids.com/index.php?option=com_content&task=view&id=15&Itemid=26


here's code I added to a static content page:
Code:
<html>
<head>
    <link rel="stylesheet" type="text/css" href="http://www.emrgrids.com/extjs/resources/css/ext-all.css"/>
    <link rel="stylesheet" type="text/css" href="http://www.emrgrids.com/extjs/resources/css/xtheme-default.css" /><!-- LIBS -->

    <script type="text/javascript" src="http://www.emrgrids.com/extjs/adapter/ext/ext-base.js"></script>
    <!-- ENDLIBS -->

    <script type="text/javascript" src="http://www.emrgrids.com/extjs/ext-all.js"></script>

    <script type="text/javascript" src="http://www.emrgrids.com/extjs/examples/form/states.js"></script>
    <script type="text/javascript" src="http://www.emrgrids.com/extjs/examples/form/dynamic.js"></script>
    <link rel="stylesheet" type="text/css" href="http://www.emrgrids.com/extjs/examples/form/forms.css"/>

    <!-- Common Styles for the examples -->
    <link rel="stylesheet" type="text/css" href="http://www.emrgrids.com/extjs/examples/examples.css"/>
</head>
<body>
<script type="text/javascript" src="http://www.emrgrids.com/extjs/examples/examples.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.emrgrids.com/extjs/examples/lib.css" /><div id="lib-bar" class="x-toolbar" style="border-width:0 1px 1px"><div id="lib-bar-inner"> <span>Theme:</span>&#160;&#160;<select id="exttheme"><option value="default">Ext Blue</option><option value="gray">Gray Theme</option></select></div></div>
<h1>Dynamic Forms built with JavaScript</h1>

<p>
    These forms do not do anything and have very little validation. They solely demonstrate
    how you can use Ext Forms to build and layout forms on the fly.
</p>
</body>
</html>

Anyone know what I can do to get this inside the template?
« Last Edit: April 13, 2008, 11:59:21 AM by Adam Parker » Logged
Adam Parker
Sr. Rocketeer
****
Offline Offline

Posts: 101


Re: How can I embed a javascript form inside content? (template breaks)
« Reply #1 on: April 13, 2008, 12:01:58 PM »

update: I put the <head> stuff into a module, and only these lines into the content, and still breaks template:
Code:
<script type="text/javascript" src="http://www.emrgrids.com/extjs/examples/examples.js"></script>
<h1>Dynamic Forms built with JavaScript</h1>

<p>
    These forms do not do anything and have very little validation. They solely demonstrate
    how you can use Ext Forms to build and layout forms on the fly.
</p>
Logged
March
Rocketeer
***
Offline Offline

Posts: 65


WWW
Re: How can I embed a javascript form inside content? (template breaks)
« Reply #2 on: April 13, 2008, 08:09:34 PM »

I use this extension and it works great. http://www.fijiwebdesign.com/products/joomla-php-module.html

They also make a mod_html but I haven't tried it yet. You'll need to put the code into a module, but you can have multiple modules.
Logged

Adam Parker
Sr. Rocketeer
****
Offline Offline

Posts: 101


Re: How can I embed a javascript form inside content? (template breaks)
« Reply #3 on: April 13, 2008, 08:12:51 PM »

i actually (sort of) fixed it.  My forms were rendering into the body, but I created divs for them to render to inside the static content.  2 problems though:

1) something is still rendering to body because template looks weird
2) will this form have access to Joomla so i can use "$my->username"?
« Last Edit: April 13, 2008, 08:56:05 PM by Adam Parker » Logged
Pages: [1] Go Up Print 
RocketTheme  |  General  |  The Water Cooler  |  Topic: How can I embed a javascript form inside content? (template breaks) « previous next »
Jump to:  

viagra professional