Cmsms not saving

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
stevess
New Member
New Member
Posts: 3
Joined: Tue May 10, 2011 6:26 pm

Cmsms not saving

Post by stevess »

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.
Mantlet
Forum Members
Forum Members
Posts: 114
Joined: Fri Apr 28, 2006 9:42 am

Re: Cmsms not saving

Post by Mantlet »

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.
stevess
New Member
New Member
Posts: 3
Joined: Tue May 10, 2011 6:26 pm

Re: Cmsms not saving

Post by stevess »

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.
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: Cmsms not saving

Post by Wishbone »

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'
stevess
New Member
New Member
Posts: 3
Joined: Tue May 10, 2011 6:26 pm

Re: Cmsms not saving

Post by stevess »

Thanks for the ideas.
Will try them out...
applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am

Re: Cmsms not saving

Post by applejack »

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.
Post Reply

Return to “Layout and Design (CSS & HTML)”