Changing Required Fields - ILLiad

Follow

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 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

Most fields in the WebValidation table contain the regular expression .+ meaning that any character (including a space) is valid in that field, but that the field requires at least one character to be entered or it will return an error message. If you want to make a field not required, you can either delete the entry from the WebValidation table or change the regular expression value to .* meaning that any character would be valid and even those characters are optional. You will also need to edit the web page to remove the asterisk from the field.

To change a value in the Validation column to not required, click on the row you want to change to open the edit form.

  1. Change the value to .* (see Web Validation Syntax for more information).
  2. Strike your Enter or Return key to activate the Save icon.
  3. Click Save to save your changes and close the edit form.

For Shared Server sites, the NVTGC for an entry must be set to ILL in order to share web pages.

Delete a Validation Entry

If you want to eliminate an existing required field, you can delete it from the WebValidation table.

  1. Choose the row for the field you wish to eliminate by clicking on that row.
  2. Click the Delete button.
  3. You will be asked to verify that you want to delete the record. Note that this action cannot be undone.

Editing the Web Form

No matter which method you use to change a required field value to not required, you will need to edit the web page to remove the asterisk from the field. 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>

If you have designated a field 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>
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.