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

  • Home
  • SEARCH
  • 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 4071788
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:48:06+00:00 2026-05-20T16:48:06+00:00

I have a problem of passing data from one textarea to another textarea on

  • 0

I have a problem of passing data from one textarea to another textarea on another page. I’m using php POST function in order to retrieve data from the first page. Also, I have JavaScript inserting data into the textarea on the first page with the help of JSON and PHP talking to MySQL database. Inserting data into textarea from the database on the first page works.

When I click on the submit button on the first page, no data is passed to the second page. Many thanks for your help.

Page 1
-----------------------------------------------------------------------------------------
<form action="page2.php" method="post" id="role" name="roleForm">
<fieldset id="fieldset">
<legend id="legend">Background</legend>
<p>
  <label for="background"></label>
  <textarea name="background" cols="71" rows="10" id="backgroundtext">
</textarea></p>
</fieldset>
<br></br>
<p><input type="submit" name="Submit" value="Add role to job description" id="addjobdesc" /></p>
</form>


JavaScript file (part of the file)
---------------------------------------------------------------------------------------
function set_background (newValue)
{
    var field = document.roleForm.backgroundtext;
    field.value = newValue;
}



page2.php
-------------------------------------------------------------------------------------------
<fieldset id="fieldset">
<legend id="legend">Background</legend>
<p>
  <label for="background2"></label>
  <textarea name="background2" cols="71" rows="10" id="backgroundtext2" value="<?php echo $_POST["background"]; ?>"/>     
</textarea></p>
</fieldset>
<br></br>
  • 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-05-20T16:48:07+00:00Added an answer on May 20, 2026 at 4:48 pm

    You have to write the content of the textarea BETWEEN the tags, not into a value attribute:

    <textarea name="background2" cols="71" rows="10" id="backgroundtext2">
    <?php echo $_POST["background"]; ?></textarea>
    

    Be aware that this code is extremly unsafe! If the $_POST[“background”] contains HTML it will be brake down your html-code etc.

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

Sidebar

Related Questions

i have problem passing data from one page to another using GET, for example
In my MVC application I have a problem with passing data from view to
I have a problem using the Java search function in Eclipse on a particular
I have a problem with passing of an array from Fortran to a c
I'm working on a project where I have to take data from one source
I'm experimenting with WCF Services, and have come across a problem with passing Interfaces.
I have problem when I try insert some data to Informix TEXT column via
I have a page where a user can import data to the site. either
I have a problem on going back (clicking the Back button) from sub-activity to
A few days ago I asked about passing a data structure from java to

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.