develooper Front page | perl.beginners | Postings from March 2002

Re-displaying data back into forms

Thread Previous | Thread Next
Troy May
March 14, 2002 20:47
Re-displaying data back into forms
Message ID:

This may be hard to explain, but I have a form consisting of 3 one-line text
boxes, and 1 multi-line textarea box.  When I load the page each and every
time, I want the PREVIOUS data to be displayed in the text boxes.  Similiar
to web forums when you click to EDIT your own post and it shows all the data
in the text boxes to edit.  So I have the CGI writing to a temp file in this

Test Test Test |Test Test Test |Test Test Test |This is the text in the
multi-line message box.

Then I have the following code to re-assign it to variables:

unless ($action) {
open (TEMP,"$filename2") or die "Can't Open $filename2: $!\n";
$line = <TEMP>;
($dt, $time, $topic, $eurom) = split(/\|/, $line);
$eurom =~ s/<p>/\r/g;  # I'm not sure if this even works


Then when I display the form, I have the following to insert those values:
(only one tag given just to show you)

<TD width=100>Date:<INPUT size=47 name="dt" value=$dt></TD></TR>

Now, the problem is that the first 3 one line text boxes only re-display the
first word of the string, and the multi-line box only displays the first
paragraph of the data.  (until the ENTER button is pressed)

Any ideas on how to make it display ALL the data that was saved to the file.
If any of you guys and gals are familiar with web forums - I'm trying to do
what they do when you click to EDIT your post.  It shows ALL the data in the
text boxes.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About