For text boxes, to have it autofilled with something that the user can add
to or edit, simply put the text you want to appear inbetween the <textarea>
and </textarea> tags... So for instance if the string $prevtext contained
the text you wanted to be in the form, you would put it in something like
this:

print qq~
        <textarea rows="2" name="scrollingtextbox" cols="20">$prevtext</textarea>~;

R.A. Howard

-----Original Message-----
From: Troy May [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 14, 2002 11:37 PM
To: Kris Findlay
Cc: Beginners-Cgi
Subject: RE: Re-displaying data back into forms


Thanks!  That fixed the first 3 one-line text boxes.  But how do I apply
that to the textarea box where there is no "value" attribute?  Here's what I
have now:

----------------------
<TD width=195 colSpan=2>Subject:<TEXTAREA name="eurom" rows=6 wrap=virtual
cols=60>$eurom</TEXTAREA></TD></TR>
----------------------

It only displays the first paragraph.



-----Original Message-----
From: Kris Findlay [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 10, 2002 9:11 PM
To: 'Troy May'
Cc: Beginners-Cgi
Subject: RE: Re-displaying data back into forms


I had same problem with a preview post form I created..

Problem is that 'value=$dt >' assigns translates to 'value=test test
test >'
Thus only displaying the first test .

To fix it u have to make sure u have ' value="$dt" >'  this will solve
your problem.

Note: if the string $dt has any " characters in it this will also break
the value = statement.

Advise using regex to strip or replace " in your incoming data.


Kris G Findlay                          "you are only young once,
http://www.knight-shift.com                 but you can be immature
forever"

-----Original Message-----
From: Troy May [mailto:[EMAIL PROTECTED]]
Sent: 15 March 2002 04:55
To: Beginners CGI List
Subject: Re-displaying data back into forms

Hello,

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
format:

--------------------------------------------------
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>;
close(TEMP);
($dt, $time, $topic, $eurom) = split(/\|/, $line);
$eurom =~ s/<p>/\r/g;  # I'm not sure if this even works
&print_form;

}
----------------------------------------------------

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.

Thanks.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to