473,473 Members | 1,808 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

textarea lost on validation

1 New Member
I am fairly new to this so forgive me if the answer is obvious.
I have written a PHP form script that validates itself by posting back to itself.
I use VALUE=$var for all the input fields so I don't lose the inputted values.
Except the textarea does not seem to support VALUE= and its input is lost if the form input has errors.
What do I need to do to preserve the value of the textbox?
thanx in advance
jim
Jul 12 '06 #1
2 2447
Banfa
9,065 Recognized Expert Moderator Expert
remember textarea has an opening and closing tag, the initialisation data goes inbetween them

[html]
<textarea><?php echo $TextAreaData; ?></textarea>
[/html]
Jul 13 '06 #2
ronverdonk
4,258 Recognized Expert Specialist
In order to preserve it you have to give the textarea a name. That name will show up in your $_POST array.

[PHP]<?php
// At the beginning of your program you validate the $_POSTs
if (isset($_POST['that']) {
// checkit
}
// else display the form again
else {
<textarea name="that"><?php if isset($_POST['that']) echo $_POST['that'] ?></textarea>
other input, submit, etc.....
}
[/PHP]
Ronald :cool:
Jul 20 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Sunil Kulkarni | last post by:
I need to validate my TextArea as follows: 1) IT SHOULD ALLOW FOR ONLY 5 COLUMNS 2) IT SHOULD ALLOW ONLY 65 CHARACTERS PER ROW I need some kind of a JS validation for the same. I have tried...
7
by: daniel kaplan | last post by:
hello all, am new to HTML and am in the process of creating a form, no serious headaches, but am stumped on two types of fields. i can take care of these situations using javascript, but was...
0
by: ahres | last post by:
I'm using Stephen Poley's javascript form validation for a relatively simple form, but have encountered a tricky situation wherein the textarea field is frozen in IE5. When clicking in the textarea...
6
by: tony wong | last post by:
i wish to count number of characters in textarea box during typing in and display it somewhere in html page. so the number will increase during writing. is it possible to do it by javascript? ...
10
by: M K | last post by:
Is there a way to limit an asp:textarea to 100 chars on the client side? The db only accepts 100 and chops the rest off.
1
by: trihanhcie | last post by:
Hi I have several textarea in the same page. I would like to count the words in each textarea without any interaction with each other. Here's the code I used for the count : <script...
5
by: joelbyrd | last post by:
Didn't know exactly where to post this, but: How do I get line breaks in a textarea? I'm pulling text from a database, and this text definately has line breaks in it, because I replaced all the...
9
by: Andrew Poulos | last post by:
I'm dynamically populating a TEXTAREA with some info that includes a URL. Eg. frm.value = "This is the link to use <url: http://www.foo.com >"; but this results in a page that doesn't...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.