Repair Bad Credit | Mortgages | Wester Union | Loans | Internet Businesses Online Articles
forms [Archive] - PCMech Forums

PDA

View Full Version : forms


buddhad
08-17-2002, 10:40 AM
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

aym
08-18-2002, 05:08 AM
This depends on the language you are using, is it server-side like PHP Or client-side like JavaScript?

buddhad
08-18-2002, 10:28 AM
I will be using a client-side language.

aym
08-18-2002, 02:42 PM
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.

DrZaius
08-18-2002, 02:45 PM
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.

buddhad
08-18-2002, 02:53 PM
Thanks for the ideas. I will try them out and see what works best for me.

AG