jqModal dialog - only displaying once
- by James Inman
I've got a jqModal dialog with the following code:
$(document).ready( function() {
$('td.item.active').click( function(e) {
$(this).append( '<div class="new"> </div>' );
$("#jqModal").jqm({
modal:true,
onHide: function(e) {
e.w.hide(); // Hide window
e.o.remove(); // Remove overlay
}
});
$('#jqModal').jqmShow();
$('input#add_session').click( function(e) {
e.preventDefault();
$('#jqModal').hide();
$('.jqmOverlay').remove();
});
});
});
The HTML used is as follows:
<div id="jqModal" class="jqmWindow">
<form action="" method="post">
<ul>
<li>
<input id="add_session" name="commit" type="submit" value="Add Session" /> <input type="button" name="close" value="Close" id="close" class="jqmClose" />
</li>
</ul>
</form>
</div>
When I first click a <td>, the dialog launches without a problem. On the second click (or subsequent), the new class is added to the <div>, but the dialog doesn't launch.