if you're doing this on a form submit, you need to return false.  if you
simply wish to halt execution of the javascript, a simple 'exit' will do.

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 17, 2001 2:38 PM
Subject: How to abort a program in JS


> Aprogram checks a variable's value and has to abort the process if the
> value is ''FC. The same page should be displayed to let a user to change
> the value. How to do it? My program continues excution afte an alert box
is
> closed
>
> <script>
> function savedata()
> {
> <cfoutput>
>
mytopic=document.header.topic_list.options[document.header.topic_list.select
edIndex].value;</cfoutput>
> if(mytopic=='FC')
> alert(mytopic)
> alert("Please choose topic code.");
> }
> </script>
>
>
>
> (Embedded image moved to file: pic32591.pcx)


-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to