|
-
Jan 29th, 2001, 11:53 AM
#1
Thread Starter
Member
I have two problems, both dealing with the same thing, I think theyre pretty common, so there might be some 'canned' solution:
I have a forum system on my site that I wrote, but heres the probs i cant figure out:
1:
Users hitting submit twice when posting (impatient little buggers!), and usually this will result in their post getting submitted twice.
2:
people who post, then out of stupidity, hit the back button to try to edit their post and hit submit again, thus posting an original version and an edited version.
I see that a lot of sites have the page expire on submission to work around the second problem, how do you do that?
as for the first one, my kneejerk reaction is to test the database to see if a record with the exact same content has been posted (excluding the index of course), and if so, dont write it again, but i wanted to check to see if there is a easier way.
thanks in advance!
-
Jan 30th, 2001, 04:15 AM
#2
Fanatic Member
Hi glitch13
with the expiring of pages if you are using asp for this foeum of yours, you can put this at the top of you code
Response.Expires = 1
as for your first problem, there isn't really any easy way of doing it apart from as you said.
Hope this helps
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jan 30th, 2001, 08:15 AM
#3
Frenzied Member
for youyr first prob, try:
<input type=button name=submit onClick="mySubmit();">
and make a javascript function,
function mySubmit(){
var isSubmit
if (isSubmit != True){
myForm.submit();
}else{
alert('You already hit the submit dude!');
}
try this and let us know!!
-
Feb 3rd, 2001, 05:46 PM
#4
Thread Starter
Member
thanks, but I just want it to be transparent, like they can keep hitting submit, but only the first click will count.
-
Feb 4th, 2001, 11:39 PM
#5
Guru
just modify Sebs code:
function mySubmit(){
var isSubmit
if (isSubmit != True){
myForm.submit();
}else{
// do nothing
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|