|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (6 bit)
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 |
|
|
|
|
|
#2 |
|
Registered User
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?
|
|
|
|
|
|
#3 |
|
Member (6 bit)
Join Date: Mar 2002
Posts: 45
|
I will be using a client-side language.
|
|
|
|
|
|
#4 |
|
Registered User
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. |
|
|
|
|
|
#5 |
|
Member (13 bit)
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.
|
|
|
|
|
|
#6 |
|
Member (6 bit)
Join Date: Mar 2002
Posts: 45
|
Thanks for the ideas. I will try them out and see what works best for me.
AG |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|