The Aeon web pages include some "required" form fields, such as the First Name field on the Registration form. When viewing the pages on the web, these required fields are flagged with a red asterisk. Fields that are required and not filled in by a user generate error messages. Any field can be designated "required" and fields that are currently set as required can be changed. Obviously taking off or adding the asterisk on the web page is an important step for your users to know what they need to fill in, but it does not serve a purpose when formatting the pages and will not let Aeon know what your intentions are for the use of those fields. The required fields and their error messages are configured and must be edited in the WebValidation table.
Changing a Required Field
If you want to change a required field, its associated error message, or a validation that a field is measured against, use the WebValidation table found in the Aeon Customization Manager. Aeon has many default field validations built in, and you can add as many more as you need. Some example regular expressions are listed below. When a field fails to validate against one of these regular expressions, it will return the error listed in the WebValidation table on the screen and re-display the entry screen, allowing the user to make changes as necessary. 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 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.
Regular Expression | Purpose |
---|---|
.+ | This will make the field required, but allow any characters input into the field to pass validation. |
^\d\d\/\d\d\/\d\d\d\d$ | This format is for a MM/DD/YYYY date. |
^\d{9}$ | This is for a nine-digit number. |
^\d{5}(-\d{4})?$ | This is for a zip code that will take 5 digits or 5 and 4 digits (nine-digit zip code). |
\w+@\w+ | This format is for an email address in the format Aeon@atlas-sys.com. |
Changing the Validation Value
- To change a value in the Validation column to not required, click on the row you want to change to open the edit form.
- Change the value to .* as explained above.
- Strike your Enter or Return key to activate the Save icon.
- Click the Save icon to save your changes and close the edit form.
Deleting a Required Field
- 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.
- To delete the entry 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
No matter which of the two methods you use to change a required field value, 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 using the following format:
<!-- <span class="req">*</span> -->
Creating a Validation Rule for a Blank "Request For" Field Value
The Request For drop-down field on the new request web pages contains a blank field value when a researcher is listed as a proxy or associated with Activities. By default the blank field value associates the request with the researcher, however, the drop-down can be configured to validate the RequestLink field name against an empty value, forcing the user to select an option from the drop-down list. If a researcher does not choose a drop-down option and submits the blank value, an error message displays prompting the user to choose an option.
To create the validation rule for the blank Request For value, enter the following fields into the WebValidation table for each new request form:
Formname |
Fieldname |
Validation |
Error |
Error Tag |
---|---|---|---|---|
DefaultRequest (name of new request form) |
RequestLink |
.+ |
You must specify which researcher or Activity this request is for. |
ERRORRequestLink |
Hidden Fields
If you do not want a field to be visible to the customer on the Aeon web pages, but still need to set a value, you have the option of using a hidden field to insert the value for that field into the database. This code should be added at the top of the page right after the other hidden field entries. These other hidden fields may be either or both of the following depending on the page being edited:
<input type="hidden" name="SessionID" value="<#PARAM name="SessionID">">
<input type="hidden" name="AeonForm" value="XXXXXXXXXXXX">
The image shown here is from theDefaultRequest.html page and shows the Username field inserted as a hidden field.
Overriding Web Validation Values using Form Validation Override
If you want to include required fields in your web pages that are based on an option that a user selects, you can use FormValidationOverride, an input parameter that specifies an alternate form name to use when querying web validation. You could, for example, design your default request form to allow researchers to request an item as either a loan or a photocopy. You would include two form names in your WebValidation table, for example, DefaultRequestLoan and DefaultRequestCopy, listing the required fieldnames for each. In your DefaultRequest.html page, underneath the form name (AeonForm), you would include the FormValidationOverride input parameter with a value of DefaultRequestLoan, and you would include a radio button on your default request form that allows the researcher to request an item as a photocopy.
<input type="hidden" name="FormValidationOverride" value="DefaultRequestLoan">
In your javascript, you create functions that tell the DLL what to do when specific actions are taken on the form. When a researcher submits a request, javascript uses the FormValidationOverride default from the html page, (DefautlRequestLoan) unless the user checks the photoduplication option. If the user selects the option to submit the request as a photocopy order, javascript edits the FormValidationOverride value based off of the function for that selection, causing the DLL to display the required fields for the photoduplication form.
Multiple FormValidationOverride Tags
The FormValidationOverride tag may be used multiple times within the same web form. This allows you to have a FormValidationOverride tag in a file that is included in a web form using an INCLUDE tag without interfering with any existing FormValidationOverrides already on the form. The FormValidationOverride tag on the web form is formatted by setting the FormValidationOverride input parameter with a value equal to the Formname entry in the WebValidation table for the override created in the included file. When a request is submitted and the required fields are left blank, input fields for those overrides are included in the web validation processing.
<input type="hidden" name="FormValidationOverride" value="MyIncludeFile">
Altering Content-Sensitive Menus
Default pages such as DetailedInformation.html and ViewCheckedOutDetailedInformation.html include the follow line of code to create a content-sensitive menu containing commands such as Edit Request, Cancel Request and Clone Request:
<#MENU name="transaction" separator="|">
If you want to remove some of the options that show, you will need to specify the exact menu options you want using the example below. Here, options are indicated by each item element in the tag. Simply include only those options you want to see in the menu.
<#MENU name="transaction" separator="|" item="Edit:Edit Request" item="Cancel:
Cancel Request" item="RemoveHold:Remove from Hold" item="Resubmit:Resubmit
Request" item="Clone:Clone Request" item="CloneToCopy:Clone to Copy" item=
"ViewFile:View Item" item="DeleteFile:Delete Item" item="Submit:Submit Request"
item="ApproveOrderEstimate:Approve Estimate" item="ApproveOrderBilling:Approve
Billing" item="ExportRIS:Export Citation">
Other default pages containing this line of code are ViewCancelledDetailedInformation.html, ViewDefaultDetailed.html and ViewDetailedInformation.html.