Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8032301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:20:50+00:00 2026-06-05T01:20:50+00:00

I have a texteditor and I want to submit it’s content to a php

  • 0

I have a texteditor and I want to submit it’s content to a php file using jquery.

My index file is:

<!--  jquery core -->
<script src="js/jquery-1.4.1.min.js" type="text/javascript"></script>
<!-- FCK editor Starts -->
<script src="texteditor/nicEdit.js" type="text/javascript"></script>
<script type="text/javascript">
bkLib.onDomLoaded(function() {
    new nicEditor({fullPanel : true}).panelInstance('area2');
});
</script>
<!-- FCK editor End -->
<script>
$(document).ready(function(){
    $("form#submit").submit(function() {
    // we want to store the values from the form input box, then send via ajax below
    var area2     = $('#area2').attr('value');
    var pageName     = $('#pageName').attr('value');
        $.ajax({
            type: "POST",
            url: "ajax.php",
            data: "pageName="+ pageName +"& textarea="+ area2,
            success: function(){
                $('form#submit').hide(function(){$('div.success').fadeIn();});

            }
        });
    return false;
    });
});
</script>
<div class="container">
<form id="submit" method="post">
        <textarea id="area2" name="area2" class="di"><div id="responsecontainer"></div></textarea>
        <input type="text" id="pageName" name="pageName" value="home" />
        <button>Submit</button>
    </form>
    <div class="success" style="display: none;">Client has been added.</div>
</div>

My ajax.php file is:

<?php
$pgName = $_POST['pageName'];
    $content = $_POST['textarea'];
    $content = str_replace('<div id="responsecontainer">','',$content);
    $content = str_replace("</div>",'',$content);

    $fp=fopen($pgName.'.html','w+');
    fwrite($fp,$content);
    fclose($fp);
?>

It works fine for textarea and textbox but does not fetch FCK texteditor contents.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:20:52+00:00Added an answer on June 5, 2026 at 1:20 am

    Try the following:

    var area2 = $('#submit .nicEdit-main').html();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to view the HTML source of a web page, I've using ICSharpCode.TextEditor,
When I have this PHP script. <?php exec('/usr/local/bin/mate hello.txt'); ?> It doesn't work on
I have a programming text editor (written in PHP) and want to remove the
when using EditorFor(model => model.FieldName) i want to have a generic say datepicker, rich
I have this: wares.php?id=5&x1=4&x2=33&x3=1 What I want to do is to insert [1: before
I have a seesaw ui with a text editor. The editor content is backed
Have a SomeLib.pro file that contains: CONFIG += debug TEMPLATE = lib TARGET =
I have extended org.eclipse.ui.editors.text.TextEditor to implement a custom editor. For this editor, I have
I have a plain text document, which I want to compile inside LaTeX. However,
I want to be able to double-click on an .xsd and have Eclipse open

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.