File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Have a question about history.go(-1) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Have a question about history.go(-1)" Watch "Have a question about history.go(-1)" New topic
Author

Have a question about history.go(-1)

chang Anne
Greenhorn

Joined: Jul 02, 2003
Posts: 29
Hello,
I have a field in registration form.
Users enter their information.
I match the data with database, if it didn't match, I use javascrit to
show error messages and back(using history.go(-1)) to return the registration form.
My question is I want to pass a variable and back to registration form?
How should I do?
Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

I would suggest that this is not the best way to do it. Rather than trying to go back using the history, you should forward the request back to the form page and use the submitted request parameters to 'refill' the form fields as well as including any error information.
You didn't mention what you are using for back-end processing. If you are using JSP/servlets this is a very common idiom.
hth,
bear
[ August 30, 2003: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
chang Anne
Greenhorn

Joined: Jul 02, 2003
Posts: 29
Hello,
Thank your suggestion.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Have a question about history.go(-1)