Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/458.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Datatable预提交2个文件_Javascript_Jquery_Datatables - Fatal编程技术网

Javascript Datatable预提交2个文件

Javascript Datatable预提交2个文件,javascript,jquery,datatables,Javascript,Jquery,Datatables,我在数据表中有两个字段要发送:提交“价格”和“分期付款价格”(INSPRICE) 在发送之前,我需要进行验证 editor.on('preSubmit', function (e, o, action) { if (action !== 'remove') { if (o.data.PRICE != "" && (o.data.INSPRICE == "0" || o.data.INSPRICE == "")) {

我在数据表中有两个字段要发送:提交“价格”和“分期付款价格”(INSPRICE)

在发送之前,我需要进行验证

editor.on('preSubmit', function (e, o, action) {
            if (action !== 'remove') {

                if (o.data.PRICE != "" && (o.data.INSPRICE == "0" || o.data.INSPRICE == "")) {

                    if (parseInt(o.data.PRICE.replace(".", "").replace(",", ".")) < parseInt(o.data.MINPRICE) || parseInt(o.data.PRICE.replace(".", "").replace(",", ".")) > parseInt(o.data.MAXPRICE)) {
                        swal({
                            title: "PRICE!",
                            text: "PRICE IS TOO LOW",
                            type: "warning"
                        });
                        return true;
                    }


                }

                if (o.data.INSPRICE!= "0") {

                    if (parseInt(o.data.INSPRICE.replace(".", "").replace(",", ".")) < parseInt(o.data.MINPRICE) || parseInt(o.data.INSPRICE.replace(".", "").replace(",", ".")) > parseInt(o.data.MAXPRICE)) {

                        swal({
                            title: "Preço!",
                            text: "INSPRICE IS TOO LOW",
                            type: "warning"
                        });
                        return true;
                    }


                }
            };
        });
editor.on('preSubmit',函数(e,o,action){
如果(操作!=“删除”){
如果(o.data.PRICE!=“o.data.INSPRICE==“0”| | o.data.INSPRICE=”){
if(parseInt(o.data.PRICE.replace(“,”).replace(“,”)parseInt(o.data.MAXPRICE)){
游泳({
标题:“价格!”,
文字:“价格太低”,
类型:“警告”
});
返回true;
}
}
如果(o.data.INSPRICE!=“0”){
if(parseInt(o.data.INSPRICE.replace(.“,”).replace(.“,”)parseInt(o.data.MAXPRICE)){
游泳({
标题:“Preço!”,
文字:“价格太低”,
类型:“警告”
});
返回true;
}
}
};
});
我需要分别验证这些字段

这样,当我发送价格时,我会验证价格和价格

INSPRICE也会发生同样的情况

我用这个

$('#table').on('click', 'tbody td', function (e) {
            if ($(this).index() === 5) {
                indiceEditor = $(this).index();
                editor.inline(this, ['PRICE'], {
                    submitOnBlur: true
                });
            }

            $('#DTE_Field_INSPRICE').mask("#.##0,00", { reverse: true });
            if ($(this).index() === 6) {
                indiceEditor = $(this).index();
                editor.inline(this, ['INSPRICE'], {
                    submitOnBlur: true
                });
            }
        });

我正在使用变量指示器编辑器来知道我将更新哪个字段的时间

,或者如何知道单击要编辑的字段