Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 2nd, 2006, 09:56 PM
Registered User
 
Join Date: Feb 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Echo Data To Textarea Box?

Hi,

I'm trying to create a script that echoes javascript code to a textarea box depending on which checkboxes are selected.

So if all checkboxes are selected, it echoes all the data associated with each checkbox in order.


So far this is what I have:


Code:
<?php

if (isset($_POST['checkbox1'])) {

echo "echo this javascript data to mybox";

}

if (isset($_POST['checkbox2'])) {

echo "echo this javascript data to mybox";

}

?>


<html>
<head>
<title>Script</title>
</head>

<body>
<form name="myform" action="index.php" method="post">

<textarea name="mybox" cols="75" rows="5" wrap="soft">
Data goes here
</textarea>

<input type="checkbox" name="checkbox1" value="checkbox1">
<input type="checkbox" name="checkbox2" value="checkbox2">

<input type="submit" value="Submit" name="submit">

</form>
</body>
</html>

Also, how can I specify that all data is placed between two pieces of data, no matter which checkboxes are selected?

For example:

If both checkboxes are selected, the data from each would always be placed between:

TopData

*data from checkbox1
*data from checkbox2

BottomData

How can I get this to work?

Thanks.
 
Old February 9th, 2006, 04:59 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

Quote:
quote:I'm trying to create a script that echoes javascript code to a textarea box depending on which checkboxes are selected.
Use switch() ..case statement to echo in betweeen html textarea tags. User need submit the form after checkboxes choices.

`~@#\^%&*/\.<.\/-|+|_!:;..=?>
mediasworks.com project





Similar Threads
Thread Thread Starter Forum Replies Last Post
saving data from HTML textarea Durkee VB.NET 2002/2003 Basics 4 May 9th, 2008 09:25 AM
search data echo urbanaccess Access 7 January 23rd, 2007 10:54 AM
data to textarea tsimsha Classic ASP Basics 3 December 15th, 2004 07:57 AM
Inserting "TextArea" field's data problem phungleon Classic ASP Databases 11 August 2nd, 2004 05:19 PM
Display data in textarea with select statement Alex_forever MySQL 6 April 27th, 2004 06:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.