|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Hi, is there any way to empty the contents of a text area form once the form is submitted and the same page is displayed? Right now, when someone submits a form on my web page, it sends me the comments. However, if they "refresh" or "reload" the page, the same information is submitted again. I've been trying to prevent this for weeks, but can't seem to do so. Any assistance would be much appreciated!
Best, Sintrigue |
|
#2
|
|||
|
|||
|
I don't know if it will be possible using javascript, but with some serverside language it should be possible. What language are you using?
|
|
#3
|
||||
|
||||
|
Once you have finished processing the form results, use a server-side language to redirect the user back to the form.
|
|
#4
|
|||
|
|||
|
Thanks for the replies. I'm using PHP right now to process the data. Only problem is the form is redirected back to the main page where the form is.... Thanks again for any help, and all the suggestions so far.
Sintrigue |
|
#5
|
|||
|
|||
|
The reason for the information appearing in the textarea when the user is redirected to the page is because the information is cached on that page when its sent to the server. I suggest that on the page where you have your textarea that you disable the caching.
a simple meta tag will do this: <meta http-equiv="pragma" conent="no-cache"> Hope this helped you! |
|
#6
|
|||
|
|||
|
Ideea
Hi, You can use cockie and sleep(). This alow you to store the textarea content in the browser memory. You can build a function who can read from <textarea> and write the content in a cookie. Than with a loop you can ask for the funtion and set a timeout with sleep. Also you have to build a function to read the cockie. Good look.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Empty <TEXTAREA> on refresh? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|