Wrox Programmer Forums
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 2nd, 2005, 12:47 PM
Authorized User
 
Join Date: Jan 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to elania
Default history.back(-1);

hi.

i have the following code in my form.

print ("<script language='javascript'>alert('Please complete the form'); history.back(-1);</script>");

what happen is that when i click ok on the message box, it will refresh the form and all data are gone. what i want is that all the data is still there so that i can just resume filling the form.

so is there anything i can add to the code?



i'm am total newbie
__________________
i\'m am total newbie
 
Old February 2nd, 2005, 01:10 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Is there any specific reason to use the following code?
print ("<script language='javascript'>alert('Please complete the form'); history.back(-1);</script>");

If you want to validate the form using javascript, please check the following url:

http://www.4guysfromrolla.com/webtech/091998-1.shtml

Om Prakash
 
Old February 2nd, 2005, 01:13 PM
Authorized User
 
Join Date: Jan 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to elania
Default

i'm using javascript because this is the only way i know to create alert prompt in PHP.

i'm am total newbie
 
Old February 2nd, 2005, 03:14 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Remove history.back(-1); from below javascript, so that the form will not refresh.

print ("<script language='javascript'>alert('Please complete the form'); history.back(-1);</script>");


Om Prakash





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to prevent Back History after Sing Out my site hatem ASP.NET 1.0 and 1.1 Basics 2 December 28th, 2006 02:55 AM
History data stagedancer SQL Server 2000 2 December 8th, 2004 09:57 AM
Window.History pvasudevan Javascript 5 September 4th, 2004 03:49 AM
history.back or hitting the back button won't work lian_a Classic ASP Basics 4 July 29th, 2004 12:14 AM
Record History cdenequolo Classic ASP Basics 2 December 3rd, 2003 12:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.