Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: [REPLY]OnReset Navigating to a different Page


Message #1 by "Deepak Kumar Vasudevan" <deepak@c...> on Wed, 23 Jan 2002 03:42:50 -0000
Hi,

Instead of using the usual syntax (TYPE=3D"RESET") for the reset button, 
try

<input type=3D"button" name=3D"reset" value=3D"Reset" 
onClick=3D"doReset(this.form)">

and in your doReset() function, try this:

function doReset(x)
{
    //x is the form object...
   if (window.confirm("Are you sure you want to reset this form?")) {
            x.reset(); //Reset the form...
            self.location.href =3D "reset.asp"; //Redirect to reset.asp 
page...
    }
}


Did this solve your problem?

deepak

~~~~~~~~~~~~~~~~~~~~~
Subject: Redirect Using JS
From: "Jeff McFarland" <jeff@s...>
Date: Tue, 22 Jan 2002 20:45:31
X-Message-Number: 4

What's up everyone...

This is what I need help with.  When someone clicks the "reset" button 
on
my form, they get an alert that says "You are about to reset your 
form"...
and if the click cancel... nothing happens, but if they click OK, the 
just
will forward to a reset.asp.

Here is what I have, but it doesn't work:

function doReset()
{
   if (window.confirm("Are you sure you want to reset this form?")) {
	window.navigate=3D'reset.asp';
    }
}

</Script>

Do you guys have any ideas?

Thx


---


Have you seen http://www.norada.com/tour ?

  Return to Index