Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3363

Set up messageBox type conditionally.

$
0
0

How do I set the type of message box based on a variable?

 

 

For example I have a warning message box...

 

 

MessageBox.warning("My Message", {

.........

}):

 

 

But, say for example I only want to display a warning message box if a variable 'warning' is true, otherwise create a confim message box.

 

 

if (warning){

   MessageBox.warning("My Message", {

   .........

   }):

}

else

{

   MessageBox.confirm("My Message", {

   .........

   }):

}

 

However the above code is totally unmanageable as the body of the message contains a lot of code.

 

What else can I do?


Viewing all articles
Browse latest Browse all 3363

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>