jamesjs
asked on
Form question
I have a form that after the user fills out the form then hits submit goes to a asp page. At this point the user can check the information they filled out and if alls correct they hit the submit button.The users information then goes into the database and gives them a confirmation page. Now for my questions. How to I keep the user from hitting the back button and submitting it again. More importantly how do I not show the information in case the user leaves a public computer and anther users walks up and hit's the back button and see's all the user's private inforamtion. This site was written using Frontpage 2002.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
Follow up:
<body onLoad="document.form1.res et();">
make sure to right click your form, click properties and in the form name field type form1 don't type FORM1 or Form1, just form1.
Regards
hhammash
Follow up:
<body onLoad="document.form1.res
make sure to right click your form, click properties and in the form name field type form1 don't type FORM1 or Form1, just form1.
Regards
hhammash
hhammash's fix will blank the form, but the user can still resubmit the form, which was another part of the "problem" posed by jamesjs.
My solution will prevent both the viewing of the entries and prevent the resubmission of the form.
My solution will prevent both the viewing of the entries and prevent the resubmission of the form.
Hi Jamesjs,
If the user click back button and finds it disable he can go back and access the form from the main link.
The simple solution to that is to put validation for the first field. So when the user clicks the back button he/she will not be able to submit it blank.
Also you can put this Meta Tag under your <HTML> to refresh the form is the user leave it while fillign for any emergency. I mean if the user had a reason to leave the form filled but unfinished on the screen, it will refresh itself so that nobody can read it.
<META HTTP-EQUIV="Refresh" CONTENT="30;URL="http//www.yourweb.com/page.htm">
Best regards
hhammash
If the user click back button and finds it disable he can go back and access the form from the main link.
The simple solution to that is to put validation for the first field. So when the user clicks the back button he/she will not be able to submit it blank.
Also you can put this Meta Tag under your <HTML> to refresh the form is the user leave it while fillign for any emergency. I mean if the user had a reason to leave the form filled but unfinished on the screen, it will refresh itself so that nobody can read it.
<META HTTP-EQUIV="Refresh" CONTENT="30;URL="http//www.yourweb.com/page.htm">
Best regards
hhammash
With my solution, the user can not resubmit the form once submitted unless he starts a new session. A refresh nor form field validation will prevent that. And if he hits the "main link" (as posed by hhammash) to go back to the form, once again he doesn't get the form if already submitted.
If you want the user to not be able to resubmit the form again, use a non-expiring cookie and check it instead of the session variable. If you want him to be able to resubmit the form SOMETIME in the future, expire the cookie after the appropriate time period.
If you want the user to not be able to resubmit the form again, use a non-expiring cookie and check it instead of the session variable. If you want him to be able to resubmit the form SOMETIME in the future, expire the cookie after the appropriate time period.
Hi CRagsdell,
I am not saying that your solution is wrong. Please don't feel that I am debating here, we are trying to reach to a solution here.
Question:
---------
How are you going to stop the user form going to the main link and prevent him/her from submitting the form again.
By IP: He/she can use another computer if not already behind a DHCP.
By user name and password: Jamesjs can put the combination as a primary key in the database so no matter how many times they submit, they will only access the database once.
I like your solution, and I admired the code that you put. You handled it perfectly. I just gave my easy solution to Jamesjs and he can select the one he feels suitable.
We are all friends here, so please don't feel or think that I am saying that your solution is not good.
In fact I liked it.
With my best regards CRagsdell
hhammash
I am not saying that your solution is wrong. Please don't feel that I am debating here, we are trying to reach to a solution here.
Question:
---------
How are you going to stop the user form going to the main link and prevent him/her from submitting the form again.
By IP: He/she can use another computer if not already behind a DHCP.
By user name and password: Jamesjs can put the combination as a primary key in the database so no matter how many times they submit, they will only access the database once.
I like your solution, and I admired the code that you put. You handled it perfectly. I just gave my easy solution to Jamesjs and he can select the one he feels suitable.
We are all friends here, so please don't feel or think that I am saying that your solution is not good.
In fact I liked it.
With my best regards CRagsdell
hhammash
hhammash,
I appreciated your answer as well, but it just didn't address the resubmission issue. I would have offered the same solution if he hadn't added that he didn't want them to be able to resubmit the form.
Using a session value (or cookie if you want to restrict past the current session) to determine if the form has been previously submitted and then decide whether to show the form or not will prevent the user from going to the main link and trying to resubmit the form- they never see the form.
I appreciated your answer as well, but it just didn't address the resubmission issue. I would have offered the same solution if he hadn't added that he didn't want them to be able to resubmit the form.
Using a session value (or cookie if you want to restrict past the current session) to determine if the form has been previously submitted and then decide whether to show the form or not will prevent the user from going to the main link and trying to resubmit the form- they never see the form.
Hi,
Thank you CRagsdell,
I did not address the resubmission issue.
What I understood is that jamesjs was worried about the user to press back button and find the form already filled and submits it again. This is why I did not address it.
Also he can make the record as Primary Key so the same user can enter once to the database, no matter how many times he/she submits the form.
Good we cleared the issue no.
Thank you CRagsdell for the follow-up.
Best regards
hhammash
Thank you CRagsdell,
I did not address the resubmission issue.
What I understood is that jamesjs was worried about the user to press back button and find the form already filled and submits it again. This is why I did not address it.
Also he can make the record as Primary Key so the same user can enter once to the database, no matter how many times he/she submits the form.
Good we cleared the issue no.
Thank you CRagsdell for the follow-up.
Best regards
hhammash
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept CRagsdell's comment as answer
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
coreybryant
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
Accept CRagsdell's comment as answer
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
coreybryant
EE Cleanup Volunteer
coreybryant,
Thanks for the cleanup!
CR
Thanks for the cleanup!
CR
All what you need is in the body tag of all your forms put:
Your body tag is originally <body>
Just insert the onLoad part after the body to look like this:
When the user hits back button. He/she will find the form blank.
<body onLoad="document.form1.res
Regards
hhammash