I'm trying to use onfocus to remove text in a text field:
<textarea name="Question" onFocus="this.value=''; return false;">blah blah</textarea>
This works as static html but in CMSMS it accepts it on "apply" but once I've submitted and recalled it for further editing it only has this:
<textarea name="Question" > i.e not saving the JS.
In the head I have:
{literal}<__script__ type="text/javascript">
var clickedIt = false;
function cleartextarea(id){
if (clickedIt == false){
id.value="";
clickedIt=true;
}
}
</__script>
{/literal}
Any thoughts?
Similarly it won't save <div class="clear"></div>
I would be very grateful for any insight.
Cmsms not saving
Re: Cmsms not saving
If this is in a WYSIWYG editor, that usually cleans up code before saving. It probably has nothing to do with CMSMS but with TinyMCE. You could put the javascript in a Global Content Block within {literal}{/literal} tags and call the GCB.
Hope this works out for you.
Hope this works out for you.
Re: Cmsms not saving
A belated reply but thank you. That worked for one problem but trying to add a jscontroller="false" to an a tag wouldn't work. You're right it's Tiny cleaning up so i turned off the WYSIWYG.
I wonder if there's a neater solution.
Again thanks.
I wonder if there's a neater solution.
Again thanks.
Re: Cmsms not saving
When I need custom HTML and WYSIWYG on the same page, I usually would put the custom HTML in a GCB (the entire <textarea> and not just the JS).. Make sure you turn off 'Use WYSIWYG'... not 'Turn WYSIWYG on/off'
Re: Cmsms not saving
Thanks for the ideas.
Will try them out...
Will try them out...
Re: Cmsms not saving
TinyMCE will remove empty divs unless you do below.
In the Advanced Tab > Extra Configuration add the lines
valid_elements : "*[*]",
extended_valid_elements : "*[*]"
[edited by moderator]
TinyMCE will also mess up any nicely formatted code and put it onto one line at times which why as mentioned above it is better to put it into a Global Content Block.
In the Advanced Tab > Extra Configuration add the lines
valid_elements : "*[*]",
extended_valid_elements : "*[*]"
[edited by moderator]
TinyMCE will also mess up any nicely formatted code and put it onto one line at times which why as mentioned above it is better to put it into a Global Content Block.