posted 16 years ago
what is the good way to implement back button?
one is history.go(-2), it looks good at first go. but there is an issue here:
it just shows the back page from browser history. this is what it is supposed to do.
but consider this scenerion:
assume there is a form and submit button on above page. now what happens is, in case of any invalid form field, we set error attribute to request, and we forward request to same page, and since request attribute is set, we will get this error message.
now user correct the form and submit again. this time no error so user go to next page. now on this next page there is a back button. if user clicks on it user will see the previous page with error. this is definitely wrong.
any suggestion here?
[ November 07, 2008: Message edited by: pooja jain ]