我给起始分数写了个js校验,但是只是出来个弹框,我想实现的是出来弹框但是也不能点击查询按钮,目前是可以点击查询按钮的;
var value1 = this.options.form.getWidgetByName("start_score").getValue();
var value2 = this.options.form.getWidgetByName("end_score").getValue();
if (value1 <= value2) {
FR.Msg.alert("错误提示", "起始分数要大于结束分数")
}
var value1 = this.options.form.getWidgetByName("start_score").getValue(); var value2 = this.options.form.getWidgetByName("end_score").getValue(); if (value1 <= value2) { //查询按钮设置为不可用 this.options.form.getWidgetByName("SEARCH").setEnable(false); FR.Msg.alert("错误提示", "起始分数要大于结束分数") }else{ //查询按钮设置为可用 this.options.form.getWidgetByName("SEARCH").setEnable(true); }
这还不简单吗,结束分数的控件设置成不能为空,
然后弹出错误提示的同时把结束分数清空,既然空了当然就不能查询了。
FR.Msg.alert("错误提示", "起始分数要大于结束分数");
this.options.form.getWidgetByName("end_score").setValue("");
写到控件的编辑事件里哦
把这个改写成end_score控件的编辑结束事件