天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 2379|回复: 0

[Iscript] 非空校验脚本示例【iscript-非空校验】

[复制链接]
purple 发表于 2011-11-22 18:34:19 | 显示全部楼层 |阅读模式
第一种方式:写在控件的校验脚本处
var value = getItemValue("Bug标题");
var rnt = "";
if(value == null || value.trim().length() <=0 )
   rnt = "Bug标题必填!";
rnt;
第二种方式:写在校验库
function checkEmpty(fieldName) {
   var value = getItemValue (fieldName);
   var rnt = "";
   if(value == null || value.trim().length() <= 0)
      rnt = fieldName + "必填!";
   return rnt ;
}
第二种方式调用方法:1、在校验脚本的左侧直接勾选。如下图所示:
调用函数库方法.jpg
2、在校验脚本处写脚本调用,参考脚本:
#include "checkEmpty";----checkEmpty函数名称
checkEmpty(“联系电话”);-----checkEmpty()方法名
调用函数带参数.jpg

本版积分规则

QQ|手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-12 06:44

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表