Field Actions - On User Input



 

Description

 

On User input is a client side action, which will be invoked whenever you change the value of a field in the form. It is used to improve the usability of a form by validating field data even before it is submitted or modify field values based on user action (on other fields).

 

 

Syntax

 

On User Input
  {
  // specify deluge code to be executed
  
  }

 

Examples

    Example 1:

     

    Assume that in a form with Emailid field, a person can register with the same Email ID only once. This validation can be done in the On User Input event of the Email ID field. An Ajax request is sent to the server to validate the Email ID. If the same emailid already exists, an error message is displayed.

     

     

    Deluge code snippet:

     

    On User Input
      {
      if (count(Register[emailid == input.emailid]) > 0)
      {
      set emailiderror = “This email id already exists”;
      show emailiderror;
      }
      }

     

    Example 2:

     

    Assume a Bug Tracker application that has a form for filing issues as shown below. The Module picklist field will display the name of all the modules. If a module is selected from the list, only those members of the team, in charge of the that module should get listed in the ‘Assigned to’ picklist. This can be done by writing an ‘On User Input’ event for the ‘Module’ picklist.

     

     

     

    Refer the Example - Free Flow Scripting in the topic, Client Side Functions -> Clear Picklist.

Example - Using Script Builder

Refer the Example - Using Script Builder in the topic,Client Side Functions -> Clear Picklist.