Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 2nd, 2006, 09:56 PM
Registered User
 
Join Date: Feb 2006
Location: , , .
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.
Reply With Quote
  #2 (permalink)  
Old February 9th, 2006, 04:59 AM
Friend of Wrox
 
Join Date: Mar 2004
Location: Bhopal, MP, India.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:57 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.