Login | Sign up | Toll-Free: 1-800-752-0455
 
 

Forum

 

2 posts by 2 authors in: Forums > CMS Builder Community
Last Post: April 14, 2017

Hi Guys.

I'm playing with having the following as an include throughout my sites, the aim being that any "<?php if (@$errorsAndAlerts): ?>" is handled by a modal window (bootstrap).

I've included a screen-grab as an example.

Can anyone see any issues in doing this?

<?php if (@$errorsAndAlerts): ?>

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content panel-danger">
<div class="modal-header panel-heading">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Error !</h4>
</div>

<div class="modal-body">
<?php echo nl2br($errorsAndAlerts); ?>
</div>

</div>
</div>
</div>

<?php endif ?>

and the following in the footer:

<script>

// alert modal
$('#myModal').modal('show');

</script>

Cheers,

Tim Forrest
Toledoh Enterprises
www.toledoh.com.au