jquery ajax bootsrap about modal pop up -
when click button class .btn-edit
modal appears, when submit ajax
request after if click button modal modal doesn't show. need refresh page work again.
$(".btn-edit").click(function(){ $('#edit-profile').modal('show'); }); $(".update-form").submit(function(s){ s.preventdefault(); var website_name = $('input[name=website_name]').val(); var website_url = $('input[name=website_url]').val(); var type = $('#type option:selected').val(); var category = $('#category option:selected').val(); var sells = $('input[name=sells]').val(); var location = $('input[name=location]').val(); var payment = $('input[name=payment]').val(); var description = $("textarea#message").val(); $('#edit-profile').modal('hide'); $.ajax({ type: "post", url: "advertiser/update", data: { _token: token, website_name: website_name, website_url: website_url, type: type, category: category, sells: sells, location: location, payment: payment, description: description }, success: function(data) { $('.wrapper').html(data); } , error: function(data) { } }); });
Comments
Post a Comment