A script-enabled browser is required for this page to function properly.

Creating HTML Parameter Form input or select events

To create an HTML Parameter Form field with input or select events:

  1. In the Object Navigator, double click the Paper Parameter Form view icon next to the Paper Parameter Form node to display the Paper Parameter Form view.

  2. Create or edit a Parameter Form field.

  3. Double-click the field object to display the Property Inspector.

  4. Under the Web Settings node, set the Additional Attributes (HTML) property to a valid JavaScript event handler.   Note: In some cases (for example, when raising messages), it may be necessary to type JavaScript code in the Before Form trigger.

To insert the JavaScript code in the Before Form trigger:

  1. In the Object Navigator, double-click the Properties icon (the properties icon) next to the report name to display the Property Inspector.

  2. Under Report Escapes, set the Before Form Type property to Text (if you will type the Javascript) or File (if you will import the JavaScript from a file).

  3. Set the Before Form Value property by clicking the ... button to either type JavaScript in the dialog box or select an HTML file with the JavaScript to import.

Examples

Example 1:   Data input validation

This example shows how to set Parameter Form fields for input validation when the report is run through the Web. Doing so will raise a message whenever an end user enters invalid data in the Parameter Form field.

  1. In the Paper Parameter Form view, create a Parameter Form field called PF_DEPTNO.

  2. Double-click the field object to display the Property Inspector:

  3. In the Object Navigator, click the Properties icon (the properties icon) next to your report name to display the Property Inspector:


<SCRIPT LANGUAGE = "JavaScript">
function isNumber(inputStr){
  for (var i = 0; i < inputStr.length; i++) {
    var oneChar = inputStr.charAt(i)
    if (oneChar < "0" || oneChar > "9") {
	  alert("Please enter a numeric value.")
      return false
	  }
	}
    return true
  }
 
function checkIt(form) {
  inputStr  = form.DEPTNO.value
  if (isNumber(inputStr)) {
    // statements if true
    } 
    else {
      form.numeric.focus()
      form.numeric.select()
    }
  }
</SCRIPT>

At runtime, if the end user enters the department name in the Runtime Parameter Form rather than the department number when running the report through the Web, the following message is raised:

Please enter a numeric value.

Example 2:   Select validation

This example shows you how to set Parameter Form fields for select validation when the report is run through the Web. Doing so will raise a message whenever an end user selects Printer from the DESTYPE list of values in the Runtime Parameter Form.

  1. In the Paper Parameter Form view, create a Parameter Form field called PF_DESTYPE.

  2. Double-click the field object to display the Property Inspector:

  3. In the Object Navigator, click the Properties icon (the properties icon) next to your report name to display the Property Inspector:


         <SCRIPT LANGUAGE = "JavaScript">
         function isPrinter(form) {
           if( form.DESTYPE.options[form.DESTYPE.selectedIndex].value 
               == 'Printer')
             alert("Please be sure that your print is installed and running.")
             return true}
           }
         </SCRIPT>

At runtime, if the end user selects PRINTER from a list of values in the DESTYPE field, the following message is raised:

Please be sure that your print is installed and running.

See also

About Parameter Form HTML extensions

About Web reports

Changing HTML Parameter Form input to uppercase