In a module I am developing, I need to attach some javascript via the form id. However, if other forms etc are added to the page, the form id changes.
eg// it goes from m6moduleform1 to m6moduleform2
This breaks all the javascript. Is there anyway to over-ride the form ids without breaking the form processing?
I would like some static Form IDs
- FantomCircuit
- Forum Members
- Posts: 75
- Joined: Fri Nov 10, 2006 1:34 am
- Location: Gold Coast, Australia
- FantomCircuit
- Forum Members
- Posts: 75
- Joined: Fri Nov 10, 2006 1:34 am
- Location: Gold Coast, Australia
Re: I would like some static Form IDs
Typical me, not acutally looking at the problem first *sigh*
it seems that the id of the form does not matter to cmsms. Is this correct? i manually set the form tag and id, and the form still seemed to work fine. Does anyone know if any functionality actually relies on the form id?
If not, why can't we directly control what the form id will be.
it seems that the id of the form does not matter to cmsms. Is this correct? i manually set the form tag and id, and the form still seemed to work fine. Does anyone know if any functionality actually relies on the form id?
If not, why can't we directly control what the form id will be.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: I would like some static Form IDs
The ID does matter. Only parameters that match that ID are directed to the module.
If you want to use javascript on some of the module output, then I suggest you assign the form id to a smarty variable, and use that in your templates.
i.e: $smarty->assign('formid',$id);
and then in your template, you can prefix all of the javascript stuff with {$formid}. Of course it gets ugly with all the {literal} and {/literal} tags, but it can be done.
I'd suggest you do something like this:
{literal}
// some javascript code above including the script tag.
var formid = {/literal}{$formid}{/literal}
// some more javascript code
{/literal}
If you want to use javascript on some of the module output, then I suggest you assign the form id to a smarty variable, and use that in your templates.
i.e: $smarty->assign('formid',$id);
and then in your template, you can prefix all of the javascript stuff with {$formid}. Of course it gets ugly with all the {literal} and {/literal} tags, but it can be done.
I'd suggest you do something like this:
{literal}
// some javascript code above including the script tag.
var formid = {/literal}{$formid}{/literal}
// some more javascript code
{/literal}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
- FantomCircuit
- Forum Members
- Posts: 75
- Joined: Fri Nov 10, 2006 1:34 am
- Location: Gold Coast, Australia
Re: I would like some static Form IDs
Oh, ok.
Hmm, good idea - thanks a lot for your help calguy!
Hmm, good idea - thanks a lot for your help calguy!
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: I would like some static Form IDs
Also, you can look at the FLVPlayer's summary and detail templates for example of integrating javascript into module output.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.