|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Hello All,
I'm trying to delete the contents of <textarea> and <name...> tags once the form is submitted to prevent the data being resubmitted if the person refreshes or reloads the browser window. I can't use a "redirect" or "header" script because once the form is submitted, it posts the entries onto the same page, displaying them as text. The contents of the <textarea> and <name...> boxes are written into variables and then loaded into the database when the form is submitted. The problem is sometimes people "refresh" the window, and the same data gets reposted. This is what I'm trying to prevent. Any assistance would be most appreciated. Sintrigue |
|
#2
|
|||
|
|||
|
Clearing textareas and so on is something you'll want to do with javascript rather than php. In the on submit handler you want something like -
textarea_name.value = ""; but that said my javascript is pretty rusty so I'm sure someone will probably be able to help you out if thats wrong. -KM- |
|
#3
|
|||
|
|||
|
Thanks, KM! I've never done any java programming, so any idea where I should put this? Thanks!
|
|
#4
|
|||
|
|||
|
Just need some javascript not java. Chuck the same query in the javascript forum, or I'm sure one of the helpful mod's will move this anyway. Don't know exact details about how to do this though since my javascript is rather rusty.
-KM- |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Empty contents of <TEXTAREA> and <NAME...> once submitted |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|