Connecting Tech Pros Worldwide Help | Site Map

Back Button POST Issue

  #1  
Old January 27th, 2006, 09:25 AM
thehuby
Guest
 
Posts: n/a
Is there any way of disabling the repost of information when a user
hits the back button?

Is the only way to do this to actually use some sort of redirect on the
page receiving the initial post (though this won't stop them hitting
back twice and possibly reposting will it?)

Thanks,

Rick

  #2  
Old January 27th, 2006, 04:05 PM
Jon
Guest
 
Posts: n/a

re: Back Button POST Issue


There isn't a true way too that I know. You could always disable the back
button with JS, but that's usually really annoying for users. I usually
write code against the condition. What I'll do is come up with the scenario
on every page that posts info (in particular inserting of records to a DB)
and ask 'what if the user clicks refresh or back'. Think about the queries,
and write some validation that ensures if they do happen to hit back, AND
they ignore the warning that a browser will throw, it won't matter anyways.
Sometimes it's difficult to write, but usually it's not a big deal.

If there is a way to disable POST data on a refresh, I'd love to know how
though :)

"thehuby" <thehuby@gmail.com> wrote in message
news:1138352953.363521.10320@f14g2000cwb.googlegro ups.com...[color=blue]
> Is there any way of disabling the repost of information when a user
> hits the back button?
>
> Is the only way to do this to actually use some sort of redirect on the
> page receiving the initial post (though this won't stop them hitting
> back twice and possibly reposting will it?)
>
> Thanks,
>
> Rick
>[/color]


  #3  
Old January 27th, 2006, 04:35 PM
Chung Leong
Guest
 
Posts: n/a

re: Back Button POST Issue



thehuby wrote:[color=blue]
> Is there any way of disabling the repost of information when a user
> hits the back button?
>
> Is the only way to do this to actually use some sort of redirect on the
> page receiving the initial post (though this won't stop them hitting
> back twice and possibly reposting will it?)[/color]

That's the way to do it. A browser will only put actual pages into the
history. A POST that doesn't not produce a page, but instead, redirects
to a GET for presentation will not cause the repost warning. And if the
new URL matches exactly that of the page containing the form, the
browser (IE at least), will treat it as though the user has not left
the page at all.

  #4  
Old January 27th, 2006, 04:55 PM
d
Guest
 
Posts: n/a

re: Back Button POST Issue


"Chung Leong" <chernyshevsky@hotmail.com> wrote in message
news:1138379070.567367.199370@g14g2000cwa.googlegr oups.com...[color=blue]
>
> thehuby wrote:[color=green]
>> Is there any way of disabling the repost of information when a user
>> hits the back button?
>>
>> Is the only way to do this to actually use some sort of redirect on the
>> page receiving the initial post (though this won't stop them hitting
>> back twice and possibly reposting will it?)[/color]
>
> That's the way to do it. A browser will only put actual pages into the
> history. A POST that doesn't not produce a page, but instead, redirects
> to a GET for presentation will not cause the repost warning. And if the
> new URL matches exactly that of the page containing the form, the
> browser (IE at least), will treat it as though the user has not left
> the page at all.[/color]

Exactly. I use this technique all the time, and it works fine on every
browser I've tested it on.


  #5  
Old January 27th, 2006, 05:45 PM
Jon
Guest
 
Posts: n/a

re: Back Button POST Issue


Awesome - thanks for the algorithm guys - this will save me a bit of time
with validation :)

"d" <d@example.com> wrote in message
news:Q7sCf.10254$wl.6393@text.news.blueyonder.co.u k...[color=blue]
> "Chung Leong" <chernyshevsky@hotmail.com> wrote in message
> news:1138379070.567367.199370@g14g2000cwa.googlegr oups.com...[color=green]
>>
>> thehuby wrote:[color=darkred]
>>> Is there any way of disabling the repost of information when a user
>>> hits the back button?
>>>
>>> Is the only way to do this to actually use some sort of redirect on the
>>> page receiving the initial post (though this won't stop them hitting
>>> back twice and possibly reposting will it?)[/color]
>>
>> That's the way to do it. A browser will only put actual pages into the
>> history. A POST that doesn't not produce a page, but instead, redirects
>> to a GET for presentation will not cause the repost warning. And if the
>> new URL matches exactly that of the page containing the form, the
>> browser (IE at least), will treat it as though the user has not left
>> the page at all.[/color]
>
> Exactly. I use this technique all the time, and it works fine on every
> browser I've tested it on.
>[/color]


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
preserve POST data when using the back-button Bjorn answers 23 September 27th, 2006 11:45 AM
Back button classic nileshsoni21@gmail.com answers 1 August 3rd, 2006 12:35 PM
Dealing with the Back button Tom wilson answers 29 November 19th, 2005 05:44 AM
Page Reload After Back Button - Submit Form Twice - Please Help Frawls answers 2 November 17th, 2005 04:25 AM