Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to confirm or cancel user agreement with an alert? 1

Status
Not open for further replies.

wvdba

IS-IT--Management
Jun 3, 2008
465
US
hi,
we have an asp page that is presented to user. i have been asked to pop an alert (msgbox), so that if the user presses ok, it will go on and launch the next page, else, if cancel is pressed, the application will cancel and not proceed to next page. any idea on how pop an alert in javascript with ok/cancel?
thanks.
 
Try Submit in place of alert.

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
what's the syntax and logic associated with that, please?
 
You could just use 2 <a href> s - 1 to continue and the other to cancel

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Very sorry, I meant confirm().

Here is an example. Any onclick would do.

Code:
<SCRIPT language="JavaScript">
<!--
function go_there()
{
 var where_to= confirm("Do you really want to go to this page??");
 if (where_to== true)
 {
   window.location="[URL unfurl="true"]http://yourplace.com/yourpage.htm";[/URL]
 }
 else
 {
  window.location="[URL unfurl="true"]http://www.yahoo.com";[/URL]
  }
}
//-->

</SCRIPT>

<FORM>
<INPUT TYPE="button" value="Go!" onClick="go_there()">
</FORM>

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top