Java workflow engine forms engine of JS script form field input validation

Keywords: Form Designer, field verification workflow, ccform, ccBPM workflow platform for rapid development of workflow design flow asp.net open source business process management workflow
bpm workflow system java workflow framework mainstream custom workflow engine

Description: The user input controls take input control, calibration and after input. For example, check whether it is e-mail, whether it is a mobile phone number, ID number, and so on.

A step of setting

Operating path: field, extended setting, validation script.

Field list:

Validate a ZIP code settings:

Library: System libraries, library with my own definition.

CcBPM library system is the system comes with a function library, which includes some basic, common types of authentication, such as: telephone, mail, postal code.

If the verification requires special verification, it would need a custom library, and how to define a function personalized Refer to the next section.

Point the Save button on it, the system will automatically return to the field list.

Such a script verification is complete, it is very convenient for the user's input to complete the authentication settings.

Second, how to set a custom validation function?

Provided the following steps:

1: Set up a js script file.

2: According to the event this script file, D: \ ccflow \ trunk \ DataUser \ files in the corresponding directory JSLib.
For example: onblur function on the onblur event directory, onkeypress event function in onkeypress directory.

Function names must be lowercase, examples are as follows:

function isMobil(ctrl) {

    var patrn = / ^ [+] {0,1} (\ d) {1,3} []? ([-]? ((\ d) | []) {1,12}) + $ /;

    if (!patrn.exec(ctrl.value))

    {

       alert ( 'illegal cell phone number.');

       return false;

    }

    return true

}

3. Verify script works

Directory system function is:

D:\ccflow\trunk\Data\JSLib

Directory user-defined function is:

D:\ccflow\trunk\DataUser\JSLib

Script file Form Designer automatically generates bit and

D:\ccflow\trunk\DataUser\JSLibData

When you perform the save, form designer put all the function calls taken out to generate a verification script file, the file naming format. Form Number + ". Js". Store in: D: \ ccflow \ trunk \ DataUser \ JSLibData directory.

The form is loaded, put this script file automatically transferred to the interface.

Third, how (using built-in functions ccform) by obtaining a form control value?

We know that there are four kinds of controls are dropdownlistbox, textbox, checkbox, ridionbutton in ccform Form Designer.

System built three functions, namely, to get the value of the corresponding object, please refer to the above picture.

Get input values ​​ReqTB TextBox type field.

ReqDDL get selected value of DropDownListbox.

ReqCB get the value of the CheckBox.

Fourth, how to do a complete validation before submitting form input?

Keywords: ccform field validation workflow engine input before submitting integrity verification

Procedure:

Js file to establish a custom, on the D: \ ccflow \ trunk \ DataUser \ JSLibData \ below.

Naming format for the form ID + "_ Self.js". For example: ND1701_Self.js

Create a check function in a custom js file (ND1701_Self.js) in.

3, open the node attribute = "function button found on the state of tag =" Send button label = "text box fill button js function: return IsSubmit ();

V. extended reading 1-- control with a control operation to control other properties

How ccform with a control operation to control other control properties.

对一个控件的操作让其控制其他的控件属性的变化,这样的场景比较多。比如:一个checkbox是填写更多资料,当用户选择这个checkbox时,其他的数据控件是可以填写的否则是不可以填写的。

如何在ccform中实现它?请按照如下步骤设置:

1, 创建一个表单比如:

 

 

 

 

 

 

 

2,创建该表单的JS文件。

3,处理设置.

在该字段上点扩展属性,然后找到【正则表达式/事件】

4, 设置到属性里

5, 预览并调试效果。

选择前:

选择后:

Guess you like

Origin www.cnblogs.com/mengjuan/p/11991141.html