How do I make a JS alert look like a Bootstrap alert?

Bren

Member
Hello All.
I have a simple If condition in the JS section of a button element that makes an alert popup when the else happens:
Code:
var duration = Fabrik.getBlock('form_1').formElements.get('bw_projects___duration');
/* Get an element's value: */
value = duration.get('value');
if (value !== 0) {window.open("http://localhost/gantt/gantt.php");} else {alert("Please enter a start date & end date first.");}
The typical Javascript alert popup is just so ugly. I would rather that alert be something nicer like a Bootstrap alert. I've tried searching the forum and Googling without any luck. If anyone would have any suggestions it would be greatly appreciated.
Thanks in advance.
 
Are you talking about bootstrap modals?

Bootstrap alerts and modals are two very different things. Alerts are just a particular styling of div. Modals are popup windows.

-- hugh
 
Hi Hugh.
Yes, I understand they are both very different. I just wanted to put a couple of options out there to show that I'm open to whatever is easiest implemented via the button element JS section. I use the NoNumber Modal extension within a list intro within another part of my site; but I only know how to create the NoNumber Modals using HTML. For example:
Code:
<p>{modal images/Legend.PNG|title=Legend}Color Legend{/modal}</p>
Not sure if the NoNumber Modal extension can be called within the button element JS section or not. So, I'm open to anything that would be nicer looking than the standard JS alert.
Any suggestions would be greatly appreciated. Thanks in advance.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top