SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old June 24th, 2004, 11:40 PM
sintrigue sintrigue is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 12 sintrigue User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Empty contents of <TEXTAREA> and <NAME...> once submitted

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

Reply With Quote
  #2  
Old June 25th, 2004, 03:38 AM
kode_monkey kode_monkey is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 367 kode_monkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 21 sec
Reputation Power: 5
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-

Reply With Quote
  #3  
Old June 25th, 2004, 04:03 PM
sintrigue sintrigue is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 12 sintrigue User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks, KM! I've never done any java programming, so any idea where I should put this? Thanks!

Reply With Quote
  #4  
Old June 25th, 2004, 05:10 PM
kode_monkey kode_monkey is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 367 kode_monkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 21 sec
Reputation Power: 5
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-

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Empty contents of <TEXTAREA> and <NAME...> once submitted


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway