![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
To change mode from Business Analysis to Solution Design, click the “triangle and rule” toolbar button to open the dropdown list that lets you select the desired mode.Figure 29 Change to Solution Design Mode.
1. On the Capture Claim form, click the Phone field.
2. Click the Validations tab on the control’s Properties View.
3. The Define Validation page of the Define Validation dialog opens.Figure 30 Define Validation Page
4. In the Name field type the following:
5. Select On Value Change radio button.
6. Type the following JavaScript code in the Script text area:
7.
When you select On Value Change, the error message is displayed when the user specifies an invalid value and then clicks in another field, that is, at the moment the Phone field loses focus. The other option is to set the validation script to run when the form is submitted, or when the user has completed the form and clicked the Submit button. Consider which of the two options is more convenient for your user, depending on the nature of the validation. Generally, validations of the syntax of specified values are best performed when the field value is updated.When more than one control is involved, such as when you want to ensure that at least one of two or more fields are filled in, you can choose On Form Submit. You will see this below, in the validation for the Email field, when you create a validation script to ensure that the user provides either the customer’s phone number or email address, but not necessarily both.
8. Click Finish.
1. Click the Email field.
2. Click the Validations tab on the control’s Properties View.
3. The Define Validation dialog opens.
4. In the Name field type the following:
5. Click the radio button On Form Submit.
6. Type the following JavaScript code in the Script text area:
7. Type the following text in the Message area:
8. Click Finish.
1. Click the Email field.
2. Click the Validations tab on the control’s Properties View.
3. The Define Validation dialog opens.
5. Click the radio button On Value Change.
6. Type the following JavaScript code in the Script text area:
7. Type the following text in the Message area:
8. Click Finish.
1. Click the Date of Birth field.
2. Click the Validations tab on the control’s Properties View.
3. The Define Validation dialog opens.
4. In the Name field type the following:
5. Click the radio button On Value Change.
6. Type the following JavaScript code in the Script text area:
7. Type the following text in the Message area:
8. Click Finish.In this task you will examine an auto-generated validation script and edit its error message. Form fields, like the Age field, that are auto-generated from user task parameters that are themselves based on Integer Number data fields include a validation script that checks that the runtime input is a number. The auto-generated script also checks that the value is not longer than 3 digits. The allowed length is based on the length property of the data field from which the control is generated.To see the Properties View for the CustAge data field:
1. Select the data field in the Project Explorer under the process package for ProcessWithNoForms.Figure 32 Find Date Field CustAge
1.
2. Click the Validations tab on the control’s Properties View.
3. In the Execute When dropdown list, select On Form Submit.
4. Verify that the following JavaScript code is in the Script text area:
5. Verify that the text in the Message area is as follows:Claim Amount not valid. Expecting numeric format 15.2.
1. Click the Time of Accident field.
2. Click the Validations tab on the control’s Properties View.
3. The Define Validation dialog opens.
4. In the Name field type the following:
5. Click the radio button On Value Change.
6. Type the following JavaScript code in the Script text area:
7. Edit the text in the Message area to the following:
8. Click Finish.
1. In the Witness Information pane, click the Witness Phone field.
2. Click the Validations tab on the control’s Properties View.
3. The Define Validation dialog opens.
4.
5. Select the On Value Change. radio button.
6. Type the following JavaScript code in the Script text area:
7. Type the following text in the Message area:
8. Click Finish.
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |