Go Back   PCMech Forums > Help & Discussion > Internet, Web Applications, & The Cloud

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 08-17-2002, 10:40 AM   #1
Member (6 bit)
 
buddhad's Avatar
 
Join Date: Mar 2002
Posts: 45
forms

I have 2 questions:


1) Is there a way that I can prevent someone from submitting a form during certain dates and times?

2) How can I prevent someone from submitting a form, if they have already submitted it? I already prevented them from pressing the submit button multiple times, but I also don't want them to submit, leave, and submit again at another time.

Thanks

AG
buddhad is offline   Reply With Quote
Old 08-18-2002, 05:08 AM   #2
aym
Registered User
 
aym's Avatar
 
Join Date: Nov 2001
Posts: 1,965
This depends on the language you are using, is it server-side like PHP Or client-side like JavaScript?
aym is offline   Reply With Quote
Old 08-18-2002, 10:28 AM   #3
Member (6 bit)
 
buddhad's Avatar
 
Join Date: Mar 2002
Posts: 45
I will be using a client-side language.
buddhad is offline   Reply With Quote
Old 08-18-2002, 02:42 PM   #4
aym
Registered User
 
aym's Avatar
 
Join Date: Nov 2001
Posts: 1,965
If you'll use JavaScript:

1) Use the "OnSubmit" event, check the date, and allow the form to submit if the date is OK by returning true.

2) Use cookies, when submitting for the first time, set the cookie, then if the cookie is set, don't allow the form to submit.

BTW, a user how knows HTML can remove JavaScript from your page, and submit the form as many times as he likes, so you'd better use a server-side language.
aym is offline   Reply With Quote
Old 08-18-2002, 02:45 PM   #5
Member (13 bit)
 
DrZaius's Avatar
 
Join Date: Jul 2000
Location: Fullerton, CA
Posts: 7,030
Agreed, the first problem you can fix with JavaScript, but for the second one anyone can remove JavaScript or clear their cookies and re-submit the form. The better option would be to use PHP or ASP to check the users IPs.
DrZaius is offline   Reply With Quote
Old 08-18-2002, 02:53 PM   #6
Member (6 bit)
 
buddhad's Avatar
 
Join Date: Mar 2002
Posts: 45
Thanks for the ideas. I will try them out and see what works best for me.

AG
buddhad is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 03:29 PM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0