0

In Issue form, I have one IFrame which has "Show Comments" and "Email Service Guide" click function. The function is when click "Email Service Guide", open Email form.

What I want to modify is... When i click "Email Service Guide", I want to show confirm meassage box firstly. If choose "ok", want to show Email form. Else choose "Cancel", don't show any form.

I use the jquery selector, but the problem is the code showing directly the Email form firstly. What should i do? I also attach the form style and Html IFRAME portion. Thanks.. please give me some suggestion.enter image description here!enter image description here

$('#kbviewer').load(function () {
    $(this).contents().find('#btnEmailArticle').click(function () {
        var msg = confirm('The guide selected is for internal circulation. Click OK to proceed or Click Cancel.');
            if (msg) {
            window.execScript(action);
        }
    });
});
4

2 回答 2

0
$('#kbviewer').load(function () {
    $(this).contents().find('#btnEmailArticle').click(function(event) {
        var msg = confirm('The guide selected is for internal circulation. Click OK to proceed or Click Cancel.');
            if (msg) {
            window.execScript(action);
            } else {
             event.preventDefault(); 
            }
        });
    });
于 2012-08-01T04:24:40.633 回答
0

如果我理解正确,您应该style="display:none"在 iframe 上使用,然后show()在 iframe ...

$('#kbviewer').load(function () {
    $(this).contents().find('#btnEmailArticle').click(function () {
        var msg = confirm('The guide selected is for internal circulation. Click OK to proceed or Click Cancel.');
            if (msg) {
            $('#iframe').show();
            window.execScript(action);
        }
    });
});
于 2012-08-01T04:20:42.380 回答