javascript - cancel button to close fancybox 2.x -



javascript - cancel button to close fancybox 2.x -

i've created confirmation windows form using fancybox 2.x. working, form submits , load fancybox windows proper confirmation information. @ bottom of confirmation page have submit button , cancel button.

i'm using code load fancybox window when submit button clicked.

$("#contact-form").live('submit', function(e) { $.ajax({ type: "post", cache: false, url: "/form_datas/confirm/", data: $("#contact-form").serialize(), datatype: 'text', success: function(data) { $.fancybox(data, { width:600, closebtn: false, openeffect: 'none', closeeffect: 'none', oncancel: fancyclose(), onclose: fancyclose(), }); } }); homecoming false; });

the buttons on confirmation window/fancybox modal window:

<input class="submit btn button adbtn" id="confirmsubmitbtn" type="submit" value="confirm"> <button type="button" class="submit btn button adbtn" id="stopbtn">cancel</button>

the below code works submit button, not cancel button. ideas?

$( document ).ready(function() { $("#confirmsubmitbtn").click(function(e) { e.preventdefault(); parent.$.fancybox.close(true); $("#contact-form").submit(); homecoming false; }); $("#stopbtn").click(function(e) { e.preventdefault(); parent.$.fancybox.close(true); homecoming false; }); });

javascript jquery fancybox-2

Comments

Popular posts from this blog

java Multi query from Mysql using netbeans -

c# - DotNetZip fails with "stream does not support seek operations" -

c++ - StartServiceCtrlDispatcher don't can access 1063 error -