CodeCharge Studio
On Load event
Applies to
Button,
Check Box,
Editable Grid,
Hidden,
List Box,
Page,
Record,
Text Area,
Text Box
Description
- Page
This event occurs on the client side directly after the page is loaded into
the browser. This event is often used to setup the mechanism for validating
controls within the page.
- Button, Check Box, Editable Grid, Hidden, List Box, Record, Text Area, Text Box
The On Load event does not apply directly to the above controls
but is used to attach validation criteria to controls when the page loads.
This is mostly done for controls that reside within Record or Editable Grid
forms. For the above controls, On Load is not a native DHTML
event but is wired through the page On Load event.
Examples
The following is an example of the minimum length validation for a Text Box called
Textbox2 which is located within a Record form called NewRecord2.
In this case, a Validate Entry action is added to the On
Load event with the following settings:
Validate Entry
Property | Value |
Required | True |
Minimum Length | 8 |
Maximum Length | |
Input Mask | |
Regular Expression | |
Error Message | Minimum length: 8 |
Validation Function | |
As a result the generated code will be as follows (CodeCharge Studio comments
are removed):
<script language="JavaScript">
function page_NewRecord2_TextBox2_OnLoad() {
var result;
this.ccsRequired = true;
this.ccsMinLength = 8;
this.ccsErrorMessage = "Minimum length is 8";
this.ccsCaption = "";
return result;
}
function bind_events() {
check_and_bind('document.NewRecord2','onLoad',page_NewRecord2_TextBox2_OnLoad);
forms_onload();
}
window.onload = bind_events;
</script>
On-line, printable versions and updates