Support » Everything else WordPress » Visual Tab deletes form options

  • Hello.
    I’m having the issue where I have a custom form in one of my pages, and when I switch to the Visual tab, many of my form options are deleted. Any suggestions on how to fix this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi

    (@esmi)

    Forum Moderator

    Don’t switch editing tabs. If you have used the HTML tab, stick to it. Otherwise your markup will be wiped out by the Visual Editor. This is just an unfortunate side effect of the TinyMCE editor and I don’t see it changing any time soon.

    Moderator Kathryn

    (@zoonini)

    Automattic Happiness Engineer

    You can include forms in your template files to avoid this issue – no worry about code getting stripped or formatting going wonky.

    For example, in page.php below the loop you can add:

    <?php if ( is_page('contact') ):
         include("myform.php");
         endif;
    ?>

    …and create a separate file called myform.php where you have your form code. This will include the form code on the page with the slug ‘contact’ only.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Visual Tab deletes form options’ is closed to new replies.