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
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,
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.