Background I have a form that once submitted displays a bootbox dialog. If yes is selected on the form then the form detailed are posted.
Problem
Once yes has been clicked on on the dialog i would like a div to appear saying "thank you bla la"
My solution
I've added the div and hidden in using CSS
.fConfirm { display:hidden; } then in my js once the form as submitted i've tried to change the CSS properties by adding this line
$('.fConfirm').css({display:inline-block; height: 680px; width:940px;}); This line of code however kills the whole function and stops the dialog from appearing?
Am I approaching this the wrong way?
"fConfirm" Div
<div class="fConfirm"> <h2>Thank you</h2> <p>Columbus Car Finder Group will now start looking for your perfect car and will contact you by one of the contact methods you have given us. If you have any questions or would like to change anything about your search feel free to either call or send us an email. </p> </div> JQuery
$('#form1').submit(function(e) { var currentForm = this; e.preventDefault(); bootbox.confirm("Are you sure?", function(result) { if (result) { console.log("before display"); currentForm.submit(); $('.fConfirm').css({display:inline-block; height: 680px; width:940px; background: rgb(192, 192, 192); background: rgba(192, 192, 192, 0.5)); console.log("after display"); } }); });
$('.fConfirm')instead of $('.confirm'). Your div has classfConfirm.