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 9256729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:01:08+00:00 2026-06-18T12:01:08+00:00

I want to post textarea data to a php form and get its response

  • 0

I want to post textarea data to a php form and get its response back to another textarea. could you guys tell me how this can be done? I tried following but it doesn’t work!

$.post(url, dataToBeSent, function(data, textStatus) {

   url="./doit.php";
   var dataToBeSent = $("myform").serialize();

var siteContents2 = data.contents;  
document.myform2.outputtext2.value = siteContents2 ;

}, "json");

forms:

<form id="myform" name="myform" action="./ok1.php?Id=&title=" method="post">
<td><textarea rows="7" cols="15" name="outputtext" style="width: 99%;"></textarea></td>

</form>

<form id="myform2" name="myform2" action="./ok2.php?Id=&title=" method="post">
<td><textarea rows="7" cols="15" name="outputtext2" style="width: 99%;"></textarea></td>

</form>

php get data passed beg getjson:

$passed3 = $_post['dataToBeSent'];
echo $passed3;
  • 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-18T12:01:10+00:00Added an answer on June 18, 2026 at 12:01 pm

    You define the URL and data in the callback function. You need to define them before you call $.post(). You can try it with the code below, this is the ‘shorthand‘ version with $.ajax().

    JS

    $.ajax(
    {
        type: 'POST',
        url: './doit.php',
        data: $("#myform").serialize(),
        success: function(data)
        {
            $('.result').html(data);
            $('textarea[name="outputtext2"]').val(data);
        }
    });
    

    PHP

    $formData = $_POST;
    echo $formData['outputtext'];
    

    More information about POST-requests with jQuery: http://api.jquery.com/jQuery.post/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to post some data via javascript to another domain. Something like: http://www.othersite.com/submitfunnyname?name=blah
I want to make a form like this, and i want to post the
I want to create external JS file for the form and post that data
I have a form that does not seem to want to write its data
I want to submit form data to another url (website on another server) capture
I want to post a forma poupup window. Problem is, the form posts successfully
I want to post some data to a file via ajax when somebody clicks
I want to post some values from a simple HTML form, validate them with
<form action=<?php $self ?> method=post> <h2>LundaBlogg</h2> <div class=fname><label for=name><p>Namn:</p></label><input name=name type=text cols=20 onkeyup=EnforceMaximumLength(this,12)/></div> <div
this is probably really simple for a jQuery expert. I have <div id="form23"><form><textarea>blahblah</textarea><input type="button"

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.