Form elements in Redactor

I’m trying to insert a form into a redactor instance. The form is very simple, something like:

<form name="form" method="post" action="">
  <input name="company" type="text" id="company" />
  <input name="name" type="text" id="name" />
  <input name="company-number" type="hidden" id="company-number" value="" />
  <input type="submit" id="submit" value="Send" />
</form>

This causes the page to go into the endless saving loop. If I remove the everything works fine. Does Redactor have a problem with inserting forms or specific form elements?

The HTML code above is pasted into Redactor by clicking on the “HTML” button, which shows the raw HTML code.

Because Redactor is directly on the page (vs for example TinyMCE which operates in an iframe), the form is being inserted into the actual page edit form of the manager. That’s definitely a recipe for disaster… Redactor is also likely to clean it up at some point.

I would advise against using a form element directly in a RTE. Put it in a chunk, or use a dedicated ContentBlocks field (code field if you want it editable, or chunk field if not) to insert it cleanly in a way that’s also safe for clients.

Thanks Mark. I thought that might be the case, but wanted to check in case I was doing something wrong.

Correction: it’s not the <form> tag, but the id="submit" that’s the problem. That’s conflicting with something in ExtJS trying to submit the form panel. Changing that makes it work much better.