jQuery显示消息

时间:2011-12-15 06:19:22

标签: jquery

点击提交按钮后如何使用jQuery显示消息,延迟消息框例如10 secund然后发送数据表单。

或者在消息框中单击“确定”按钮后发送数据表单。

2 个答案:

答案 0 :(得分:0)

在提交时,会弹出一个js确认框。

$('.form').submit(function() {
    return confirm('Are you sure you want to submit this form');
});

答案 1 :(得分:0)

我做了同样的事情,但是我使用了jQuery Plugin Modal Popup
http://www.ericmmartin.com/projects/simplemodal/

我做的是

        $('#submitForm').live("click",function(){
                $.modal("<h1>Thank you for submitting</h1>");
                setTimeout(function(){
                    $('#simplemodal-overlay').remove();
                    $('#simplemodal-container').remove();
                    //window.location.replace("http://www.google.at"); go to custom URL
                },2000);                
        });

因此,当您单击提交按钮

时,这只会显示模态
<input id="submitForm"type="button" name="Progress" value="Submit"></input>

而不是简单地再次移除模态弹出并将此动作延迟2秒!