Jump to content

wysiwyg editor problems


mojito

Recommended Posts

[code]onclick="if (chkMode.checked) { chkMode.checked=!chkMode.checked;SetMode(); } document.the_form.description.value = tbContentElement.DOM.body.innerHTML;"[/code]


the above is the javascript on a form which submits other fields and a wysiwyg editor which appears to come into a hidden field labeled "description" like [code]<input type="hidden" name="description" />[/code]

Since i added another field there are problem with the javascript and i now get the following error in the i.e. dialogue document.the_form.description.value is null or not an object

I need some clues to debug the thing.

thanks

mojito [img src=\"style_emoticons/[#EMO_DIR#]/excl.gif\" style=\"vertical-align:middle\" emoid=\":excl:\" border=\"0\" alt=\"excl.gif\" /]
Link to comment
https://forums.phpfreaks.com/topic/12494-wysiwyg-editor-problems/
Share on other sites

Hi,,

my mind is that you should better use the 'id' method, instead of the 'name' method. ie:
document.getElementById('description').value

If I get your idea, you could then try something like:
<div [b]id[/b]="description" style="display:none">Testing</div>

& to make the div/element visible:
document.getElementById('description').innerHTML="new contents";
document.getElementById('description').display='block';

you should get less errors, & the method is working with most~all of modern browsers,

Hoping it helps,,

l8tr,

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.