Form Validation

Validating via Javascript in Reports Source Code

Validating via Javascript in Reports Source Code   <script type="text/javascript"> function validate_form ( ) //Check two dates, DATEORD & DATEEXP in Maintenance application {     valid = true;     if (document.FORM_R00230.R001.value == 0 && document.FORM_R00230.R002.value == 0)     {         alert ( "You have not entered any dates." );         valid = false;     }else if (document.FORM_R00230.R001.value == 0)     {         alert […]

Validate User Input

Validate User Input   When working within an mrc application that allows end-users to input data, it is often necessary to be able to validate the user's input. In most cases, validation is usually necessary within a Maintenance application or the prompt page of a Report. mrc offers the following built in validation types for […]

Validating via a Java External Object

Validating via a Java External Object   This document will explain how to call an external object Java program for validity checking. For basic information regarding validity checking please see this document. The source code for the Java used in this example can be found here. The purpose of this object is to check to […]

Validating via an SQL Procedure Source Code

Validating via an SQL Procedure Source Code   create procedure mrcworklib.validdates (inout i_error char(99),  inout i_strdate decimal(8,0),  inout i_enddate decimal(8,0)) LANGUAGE SQL CASE when i_strdate = 0 and i_enddate = 0 then    set i_error = 'You have not entered any dates.'; when i_strdate = 0 then    set i_error = 'You must enter a starting date.'; […]

Validating via an SQL External Object

Validating via an SQL Procedure   This document will explain how to create and call an external object SQL procedure for validity checking. For basic information regarding validity checking please see this document. The source code for the SQL used in this example can be found here. The purpose of this object is to check […]

Validating via JavaScript

Validating via JavaScript   This document will explain how to create a JavaScript function for validity checking. For basic information regarding validity checking please see this document. The purpose of this JavaScript is to check to see if the start date is less than the end date. Note: This is a very simple example that […]

Validating via Javascript in Maintainers Source Code

Validating via Javascript in Maintainers Source Code   <script type="text/javascript"> function validate_form ( ) //Check two dates, DATEORD & DATEEXP in Maintenance application {     valid = true;     if (document.FORM_M00230.STARTDATE[0].value == 0 && document.FORM_M00230.ENDDATE[0].value == 0)     {         alert ( "You have not entered any dates." );         valid = false;     }else if (document.FORM_M00230.STARTDATE[0].value == 0)     {         alert […]

Validating via a Java External Object Source Code

Validating via a Java External Object Source Code   package MRCWORKLIB; public class Validate {     public void valid_fields(String[] args)     {         String strdatex = args[1].replaceAll(",", "");         String enddatex = args[2].replaceAll(",", "");         int strdate = Integer.parseInt(strdatex);         int enddate= Integer.parseInt(enddatex);         if ((strdatex.compareTo("0") == 0 ) && (enddatex.compareTo("0") == 0 ))             {             args[0] = "You have not entered any […]

Validating via an RPG External Object

Validating via an RPG External Object   This document will explain how to call an external object RPG program for validity checking. For basic information regarding validity checking please see this document. The source code for this RPG can be found here. For the sake of this documentation, the RPG code will be located in […]