Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 2nd, 2005, 12:47 PM
Authorized User
 
Join Date: Jan 2005
Location: , , .
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
Reply With Quote
  #2 (permalink)  
Old February 2nd, 2005, 01:10 PM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
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
Reply With Quote
  #3 (permalink)  
Old February 2nd, 2005, 01:13 PM
Authorized User
 
Join Date: Jan 2005
Location: , , .
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
Reply With Quote
  #4 (permalink)  
Old February 2nd, 2005, 03:14 PM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:26 PM.


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