I want to create a modal form, but I don't know what the right way is.
So far, I have this:
<a href="#mod_f_a" role="button" class="btn" data-toggle="modal"><?php echo JText::_('COM_SMART_NEW_A') ?></a>
<div class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="mod_f_a" aria-hidden="true">
<form class="form-horizontal" name="form_a" id="form_a" method="post" action="<?php echo JRoute::_('index.php?option=com_smart' ); ?>">
<div class="modal-header">
some header
</div>
<div class="modal-body">
some form fields
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><?php echo JText::_('COM_SMART_CLOSE') ?></button>
<button type="submit" class="btn btn-primary"><?php echo JText::_('COM_SMART_SAVE') ?></button>
</div>
</form>
</div>
Notice that here I'm using class="model-footer"
, instead of the usual class="form-actions"
. What I don't like about this approach is that there is an annoying white gap in the end.
Is there any way I can make it look like a regular modal window without having to change the css?