开发者

How do I let to browser to remember the input of the text area

开发者 https://www.devze.com 2023-01-06 06:48 出处:网络
In case a user forgets to enter an input area or enters an invalid code, and then comes back to the page where the users was filling a form, then he/she will face that his/her textarea is empty. And w

In case a user forgets to enter an input area or enters an invalid code, and then comes back to the page where the users was filling a form, then he/she will face that his/her textarea is empty. And won't want to fill it again. I want from the browser to remember what was written in it. How I'll do that?

<textarea cols="60" name="event" rows="20"></textarea>

(Yes I can validate with javascript the email-name etc areas befo开发者_运维问答re the send button but I was unable to validate the captcha by a javasript)


If you are using PHP in server side and form have method="POST":

<textarea cols="60" name="event" rows="20"><? echo $_POST['event'] ?></textarea>

Or if you textarea have any text typed by default:

<textarea cols="60" name="event" rows="20"><? echo (!isset($_POST['event']))?("Default textarea data."):($_POST['event']) ?></textarea>
0

精彩评论

暂无评论...
验证码 换一张
取 消