Validation 在何处放置mootools验证的确认弹出窗口

Validation 在何处放置mootools验证的确认弹出窗口,validation,popup,mootools,alert,confirm,Validation,Popup,Mootools,Alert,Confirm,我可以将mootools验证工具的确认弹出窗口放在哪里 确认脚本: <script type="text/javascript"> window.addEvent('domready', function(){ // The elements used. var myForm = document.id('leadForm'), myResult = document.id('myResult');

我可以将mootools验证工具的确认弹出窗口放在哪里

确认脚本:

<script type="text/javascript">

    window.addEvent('domready', function(){

        // The elements used.
        var myForm = document.id('leadForm'),
            myResult = document.id('myResult');

        // Labels over the inputs.
        myForm.getElements('[type=text], textarea, select' ).each(function(el){
            new OverText(el);
        });

        // Validation.
        new Form.Validator.Inline(myForm);

        // Ajax (integrates with the validator).
        new Form.Request(leadForm, myResult, {
            requestOptions: {
                'spinnerTarget': myForm
            },
            extraData: { // This is just to make this example work.
                'html': 'Form sent.'
            }
        });

    });
    </script>
如果(确认('您是否已查看信息?')){ }

mootools脚本:

<script type="text/javascript">

    window.addEvent('domready', function(){

        // The elements used.
        var myForm = document.id('leadForm'),
            myResult = document.id('myResult');

        // Labels over the inputs.
        myForm.getElements('[type=text], textarea, select' ).each(function(el){
            new OverText(el);
        });

        // Validation.
        new Form.Validator.Inline(myForm);

        // Ajax (integrates with the validator).
        new Form.Request(leadForm, myResult, {
            requestOptions: {
                'spinnerTarget': myForm
            },
            extraData: { // This is just to make this example work.
                'html': 'Form sent.'
            }
        });

    });
    </script>

addEvent('domready',function(){
//使用的元素。
var myForm=document.id('leadForm'),
myResult=document.id('myResult');
//输入上的标签。
getElements('[type=text],textarea,select')。每个(函数(el){
新超文本;
});
//验证。
新的Form.Validator.Inline(myForm);
//Ajax(与验证器集成)。
新表单。请求(leadForm、myResult、{
请求选项:{
“spinnerTarget”:myForm
},
extraData:{//这只是为了让这个例子起作用。
“html”:“表单已发送。”
}
});
});
我可以将确认放在哪里,以便在发送表单之前,弹出窗口会提醒用户回答是或否?

尝试以下方法:

$('myForm').addEvent('submit', function (event) {
    event.preventDefault();
    if (confirm('Have you reviewed the information?')) {            
        //code if true
    }else{ return false;}
});
这将添加一个事件侦听器,以便在表单提交时调用其中的函数

试试这个:

$('myForm').addEvent('submit', function (event) {
    event.preventDefault();
    if (confirm('Have you reviewed the information?')) {            
        //code if true
    }else{ return false;}
});

这将添加一个事件侦听器,以便在表单提交时调用其中的函数

你把这个也弄好了吗?让我知道其他情况谢谢您的回复!:这个也能用吗?让我知道其他情况谢谢您的回复!:D