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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stop running functions 2

Status
Not open for further replies.

snowboardr

Programmer
Joined
Feb 22, 2002
Messages
1,401
Location
PH
I have a bunch of "main" javascript functions i want to run this function:

Code:
function MAIN_FUNCTION() {
    DiscardMessage();  // if okay... continue else END HERE

}



function DiscardMessage(){
	if (confirm('Discard this message?'))   {
		
	} else {
		
	}
}

If they press "cancel" i would like it to stop running the "main" function also... so then it doesn't switch pages...

Jason

Army : Combat Engineer : 21B

 
Code:
function MAIN_FUNCTION() {
   [!]if (![/!]DiscardMessage()[!]){
      return false;
   }[/!]
   //continue
}



function DiscardMessage(){
    if (confirm('Discard this message?'))   {
        [!]return true;[/!]
    } else {
        [!]return false;[/!]
    }
}

-kaht

Looking for a puppy?

silky-icon-left.gif
[small]Silky Terriers are small, relatively odorless dogs that shed no fur and make great indoor pets.[/small]
silky-icon-right.gif
 
You're welcome.

-kaht

Looking for a puppy?

silky-icon-left.gif
[small]Silky Terriers are small, relatively odorless dogs that shed no fur and make great indoor pets.[/small]
silky-icon-right.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top