UI/JS/RoomType/AddRoomType.js

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

// JScript 文件
//定义房间类型编号
    //添加房间类型时判断该类型名称是否存在
    var RoomTypeisOK=false;
    
    CheckRoomTypeIsOk=function()
    {
           
            var roomtypename=Ext.get('typename').dom.value;
            Ext.Ajax.request({
                    url:'URL/RoomType/RoomTypeNameIsOk.aspx',
                    method:"POST",
                    params:{typename:roomtypename},
                    success: function(response, options) {  
                       var responseArray = Ext.util.JSON.decode(response.responseText); 
                                                         
                       if(responseArray.success == true){ //房间号已经存在       
                           SetValue(false);
                       }else{//房间号可以使用               
                           SetValue(true);
                       }  
                    }  
                });
            function SetValue(b){
                  RoomTypeisOK = b;//给变量赋值
            }
           return RoomTypeisOK;
     }

var AddRoomTypeForm=new Ext.form.FormPanel({
			width:375,
			height:270,
			plain:true,
			layout:"form",
			defaultType:"textfield",
			labelWidth:75,
            baseCls:"x-plain",
			//锚点布局-
			defaults:{anchor:"95%",msgTarget:"side"},
			buttonAlign:"center",
			bodyStyle:"padding:0 0 0 0",
			items:[   
			{
			        name:"typename",
			        id:'typename',
					fieldLabel:"<font color=red>类型名称</font>",
					allowBlank:false,
                    blankText:"房间类型名称不允许为空",
                    validator:CheckRoomTypeIsOk,//指定验证器
                    invalidText:'该房间类型己在存在'
			},{
			        name:"typeprice",
					fieldLabel:"类型价格",
					allowBlank:false,
                    blankText:"类型价格不允许为空",
					regex:/^[1-9][0-9.]{1,10}$/,
                    regexText:"2到10位数字可有小数点-第一位不允许有小数点"
					
			},{     
			        
后面还有 150 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。