If you want to change a required field (or its associated error message) or a validation that a field is measured against, you can use the WebValidation table in ILLiad Customization Manager. This table allows you to apply validations against any field using Regular Expressions. The WebValidation table is split out by NVTGC. This means that different sites in a Shared Server ILLiad system are able to split out web page validation and require different things on their individual sets of default web pages. ILLiad has many default field validations built-in, and you can add as many more as you need.
See Web Validation Syntax for more detailed instructions on regular expressions as well as examples of how you can use them in the WebValidation table.
Additionally, see Testing Regular Expressions for information on how to make sure your regular expressions are working.
Changing the Validation for a Field
The WebValidation table controls which values will be accepted by the ILLiad database for the designated fields. While using regular expressions allows you to control the type of data entered into the database by customers over the web, those restrictions cannot be disabled within the web pages once put in place without removing or editing the value in the WebValidation table. For example, you would not want to restrict the inclusive pages field to be required and only accept numbers because customers could not type in "table of contents" or "12-eoa" etc.
Make a Field Required or Not Required
Using the Required Checkbox and Validation Column
Checking the Required box for a field in the WebValidation table will ensure that the field will not accept null values, i.e. the user cannot skip that field when filling out the web form and must enter a value. The value entered by the user must then be equal to the expression noted in the Validation column unless the validation is '.+' in which case any value entered will be accepted. For example, if the Password1 field is checked as required and the validation is set to ^.{10,}$ then the password value is required to have 10 characters.
If the Required checkbox is not checked but there is an expression in the Validation column for the field, this means that the field will accept null values, i.e. the user can skip the field when filling out the web form. However, if the user does not skip the field and instead enters a value, then this value must match the expression noted for the field in the Validation column.
Delete a Validation Entry
If you want to eliminate an existing required field, you can delete it from the WebValidation table.
- Choose the row for the field you wish to eliminate by clicking on that row.
- Click the Delete button.
- You will be asked to verify that you want to delete the record. Note that this action cannot be undone.
Editing the Web Form
If you use the WebValidation table to change a required field value to not required or to add an additional required field, you will need to also mark this change for the affected field on your web pages to inform your users.
Editing the Web Form in ILLiad 9.1 or later
The ILLiad 9.1 web pages come with advanced options for indicating required fields on your web pages in order to enhance the user experience and increase the accessibility of the pages. In addition to visually marking the field as required using <span class="req">(required)</span>, you must also add either the aria-required="true" or HTML5 required attribute to the code that controls the user input for the field, typically an <input>, <textarea>, or <select> element.
Removing a Required Field Indicator
Open the web page containing the field you are changing and remove or hide the "(required)" text for that field as shown in the example below. Then, depending on which option you selected after reading Required Field Validation Options for Web Forms, either remove the aria-required="true" or HTML5 required attribute from the code that controls the user input for the field. This is typically an <input>, <textarea>, or <select> element.
This example uses the "Journal Title" field on the Article Request form:
Change this:
|
To this:
|
Adding a Required Field Indicator
If you have designated a field as a required field in the WebValidation table, you should add or unhide the "(required)" text to the field as shown in the example below using the Journal Title field. Then, depending on which option you selected after reading Required Field Validation Options for Web Forms, either add the aria-required="true" or HTML 5 required attribute to the code that controls the user input for the field. This is typically an <input>, <textarea>, or <select> element.
Change this:
|
To this:
|
Editing the Web Form in ILLiad 9.0
If using the ILLiad 9.0 web pages, you can edit your web forms to add or remove the required field indicators following the examples below.
Removing a Required Field Indicator
Open the web page containing the field you are changing and remove or hide the "required" span class for that field as shown in the example below.
This example uses the Department field, a required field on the Registration page (NewUserRegistration.html).
<label for="Department">
<span class="field">
<!-- <span class="req">*</span> -->
<span class="<#ERROR name="ERRORDepartment">"><b>Department</b></span>
</span>
<select id="Department" name="Department" size="1" class="f-name">
<option selected><#PARAM name="Department"></option>
<option>Art</option>
<option>Math</option>
<option>Music</option>
<option>Physics</option>
<option>Other - Unlisted</option>
</select><br />
</label>
Adding a Required Field Indicator
If you have designated a field as a required field in the WebValidation table, you should add an asterisk to that field on the appropriate web page.
To add the asterisk, you add the "required" span call to the field as shown in the example below using the Department field.
<label for="Department">
<span class="field">
<span class="req">*</span>
<span class="<#ERROR name="ERRORDepartment">"><b>Department</b></span>
</span>
<select id="Department" name="Department" size="1" class="f-name">
<option selected><#PARAM name="Department"></option>
<option>Art</option>
<option>Math</option>
<option>Music</option>
<option>Physics</option>
<option>Other - Unlisted</option>
</select><br />
</label>