Jump to content

TinyMCE won't submit my form data!! Please help (code included)


mrlol12

Recommended Posts

The editor appears, but when I enter test data, it doesn't submit anything to my server, nor does the page change, the save button basically does nothing. Whereas it works fine without the editor...

 

Here's this code:

 

<?php include "header.php" ?>

 

      <div id="adminHeader">

 

        <h2>Admin</h2>

        <p>You are logged in as <b><?php echo htmlspecialchars( $_SESSION['username']) ?></b>. <a href="admin.php?action=logout"?>Log out</a></p>

      </div>

 

      <h1><?php echo $results['pageTitle']?></h1>

 

      <form action="admin.php?action=<?php echo $results['formAction']?>" method="post">

            <script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>

      <script type="text/javascript" src="tinymce/jscripts/tiny_mce/jquery.tinymce.js"></script>

            <script type="text/javascript">

tinyMCE.init({

  theme : "advanced",

        mode : "textareas",

        theme_advanced_buttons3_add : "fullpage"

});

</script>

      <input type="hidden" name="articleId" value="<?php echo $results['article']->id ?>"/>

 

      <?php if ( isset( $results['errorMessage'] ) ) { ?>

        <div class="errorMessage"><?php echo $results['errorMessage'] ?></div>

      <?php } ?>

 

        <ul>

          <li>

              <label for="title">Article Title</label>

              <input type="text" name="title" id="title" placeholder="Name of the article" required autofocus maxlength="255" value="<?php echo htmlspecialchars( $results['article']->title )?>" />

          </li>

          <li>

              <label for="summary">Article Summary</label>

              <textarea name="summary" id="summary" placeholder="Brief description of the article" required maxlength="1000" style="height: 5em;"><?php echo htmlspecialchars( $results['article']->summary )?></textarea>

          </li>

          <li>

              <label for="content">Article Content</label>

              <textarea value="" name="content" id="content" placeholder="The HTML content of the article" required maxlength="100000" style="height: 30em;"><?php echo htmlspecialchars( $results['article']->content )?></textarea>

          </li>

          <li>

              <label for="publicationDate">Publication Date</label>

              <input type="date" name="publicationDate" id="publicationDate" placeholder="YYYY-MM-DD" required maxlength="10" value="<?php echo $results['article']->publicationDate ? date( "Y-m-d", $results['article']->publicationDate ) : "" ?>" />

          </li>

        </ul>

 

        <div class="buttons">

                 

          <input type="submit" name="saveChanges" value="Save Changes" />

          <input type="submit" formnovalidate name="cancel" value="Cancel" />

        </div>

 

      </form>

 

<?php if ( $results['article']->id ) { ?>

      <p><a href="admin.php?action=deleteArticle&articleId=<?php echo $results['article']->id ?>" onclick="return confirm('Delete This Article?')">Delete This Article</a></p>

<?php } ?>

 

<?php include "footer.php" ?>

 

As I said, it works fine until the editor is added!

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.