Wrox Programmer Forums
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic 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 January 18th, 2007, 07:18 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default Textarea form posting

I have a html page which has textareas which are written into. i would like this data to be outputted to a text file with included headings given. heres a sample of the source code.

Code:
<html>
<body>
<table>
<tr colspan=3><h1>Popular Music Press</h1></tr>
<tr><td valign="top">ALL</td><td colspan=2>Task: de-constuct (label and explain) NME front cover</td></tr>
<tr><td valign="top">ALL</td><td colspan=2>Demonstrate: Knowledge and understanding (MIGRAIN)</td></tr>
<tr><td valign="top">ALL</td><td valign="top" align="right">Media Language (layout of print publication):</td><td><textarea rows="4" cols="40"></textarea></td></tr>
<tr><td valign="top">ALL</td><td valign="top" align="right">Institution/Industry:</td><td><textarea rows="4" cols="40"></textarea></td></tr>

<form>
<input type="button" value="Save"/>
</form>
The form should post this data from the table into a text page. Could anyone help or suggest a method, maybe through javascript.

thanks


------------------------------------------------
Apocolypse2005
Always ready and waiting to help!
__________________
Apocolypse2005, I'm a programmer - of sorts.
 
Old January 23rd, 2007, 12:21 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hi,
i don't know how to write using javascript, but if you want try with php

$stringData =$_POST['textareaname'];
$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $stringData);
fclose($fh);


surendran
(Anything is Possible)
http://ssuren.spaces.msn.com
 
Old April 20th, 2007, 03:59 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default

Cheers for tht, it will come in handy





Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX form posting problem. NisarAhamed Ajax 0 November 21st, 2006 01:09 AM
posting a textarea with a keyboard enter md0004 Javascript How-To 4 March 12th, 2004 06:01 PM
Losing form variables (from posting) BunaZiua Dreamweaver (all versions) 1 February 23rd, 2004 04:46 PM





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