[thelist] Simple JavaScript question

Peter Small peter at genps.demon.co.uk
Mon Aug 7 04:53:23 CDT 2000


The function confirm() returns true if OK pressed. It returns false if
cancel is pressed.

Wouldn't the return have to be included in an if... then... conditional -
to direct the transfer to another URL only if true was returned by the
confirm() function?

peter (another JS learner)
http:www.avatarnets.com


>Joel Morris wrote:
>> I want to have the user click on a link and then bring up a "confirm"
>> message box verifying that they really want to go to that link. Clicking
>the
>> "OK" should send them on their way, clicking "Cancel" should keep them on
>> the same page.
>
>	Using your sample code, try this:
>
><script LANGUAGE="JavaScript">
>  <!--
>    function proceed2() {
>      return confirm("Are you sure?") ;
>    }
>  -->
></script>
>
><a href="http://www.citycent.com" onClick="return proceed2();">Click
>here</a>
>
>hth,
>James Aylard
>
>
>---------------------------------------
>For unsubscribe and other options, including
>the Tip Harvester and archive of TheList go to:
>http://lists.evolt.org Workers of the Web, evolt !







More information about the thelist mailing list