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 pop a msg before going to href page?

Status
Not open for further replies.

wvdba

IS-IT--Management
Jun 3, 2008
465
US
hi,
i have this code:
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="admissionssummary.asp"; (this is in the href below)
 }
 else
 {
  window.location="the_cancel_page";
  }
}
//-->

</SCRIPT>

<a href="admissionssummary.asp?agency=<%Response.Write objSearch("agency")%>" onClick="go_there()"> </a>
basically when they click on the link (agency), i want to pop a message to confirm that they agree with the terms of use, with ok and cancel. if they press ok, to go to admissionssummary.asp.
thanks for any ideas.
 
actually, that doesn't give a clue with href. any suggestions on href and confirm?
 
i already figured it out. it's done by using
onclick="return function()"
here's the code for everyone's benefit:
Code:
<SCRIPT language="JavaScript">
<!--
function go_there()
{
 var bok = true; 
 var where_to= confirm("Do you really want to go to this page??");
 
 if (where_to== true)
 {       
   bok = true; 
 }
 else 
 { 
   bok = false; 
 } 
 if (bok == true)
 { 
  return true;
 }
 else
 {
  return false;
 }
}
//-->

</SCRIPT>



<a href="admissionssummary.asp?agy=<%Response.Write objSearch("agency")%>" onClick="return go_there()"> </a>
cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top