Home » CMS

Tiny MCE – Getting forms to work

1 April 2009 No Comment

Getting Tiny MCE to work with forms is a challenge since it can place end form tags within the page and rename your form elements. Although they do not recommend using forms inside the editor, it can be done by some workarounds. I’ve put some common issues with forms with Tiny MCE and the workaround.

The <form name=”[OBJECT"]> bug
For instance, input fields CANNOT be named “name” (so use other identifiers for the first and last name) and ids CANNOT be named “id”. Otherwise, you will have a form element that will have a field called “<form name=”[OBJECT]“> or <form id=”[OBJECT]“>

Early </form> tags getting added in the form
Another limitation is placing <p> tags within the form. This somehow causes TinyMCE to create </form> tags after the </p> field.

If you find certain form elements getting deleted, you will need to use the extended_valid_elements variable in the configuration. 

For instance,
extended_valid_elements : “form[*],input[*],textarea[cols|rows]“,

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.

*