javascript - Load page then launch bootbox -



javascript - Load page then launch bootbox -

i'm working on function works so:

click link after page loads based on link clicked specific modal window displayed proceed modal end of functions

my problem have been running either modal won't load, or load close after page loads. here function i'm working

$(function(){ $('#new-po').click(function(){ window.location.href= $(this).attr('href'); bootbox.dialog({ title: "create new purchase order", message: '<div class="row">'+ '<div class="col-md-12">'+ '<form action="" method="post" id="create-po-form">'+ '<div class="form-group">'+ '<div class="col-md-12">'+ '<div class="form-group row">'+ '<div class="col-md-6">'+ '<label>invoice number</label>'+ '<input type="text" class="form-control" id="inv_num"/>'+ '</div>'+ '<div class="col-md-6">'+ '<label>vendor</label>'+ '<input type="text" class="form-control" id="vendor"/>'+ '</div>'+ '</div>'+ '</div>'+ '<div class="col-md-12">'+ '<div class="form-group row">'+ '<div class="col-md-6">'+ '<label>invoice number</label>'+ '<input type="text" class="form-control" id="total"/>'+ '</div>'+ '<div class="col-md-6">'+ '<label>vendor</label>'+ '<select class="form-control" id="status">'+ '<option value="" selected> -status-</option>'+ '<option value="open">open</option>'+ '<option value="closed">closed</option>'+ '<option value="void">void</option>'+ '</select>'+ '</div>'+ '</div>'+ '</div>'+ '</div>'+ '</form>'+ '</div>'+ '</div>', buttons:{ success:{ label: "create po", classname: 'btn-success', callback:function(){ } } }, onescape: function(){ } }); }); });

it uses bootbox extension, , far i've found no conflict it, i'm going go on using until otherwise stated. i've tried using $(document).ready(), $(window).load(), $(function(){}, , several other things , nil has worked. thoughts?

also references page construction on every page looks this:

<!-- header contains html starting tags , head section --> <? include "/inc/header/overall_header.php"; ?> <!-- html content here --> <!-- footer contains scripts pages , html ending tag --> <? include "/inc/header/overall_header.php"; ?>

you should move window.location.href= $(this).attr('href'); success handler of dialog

javascript jquery bootbox

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -