Field Actions - On User Input

 

Description

The 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 display other field values based on the value specified in this field. The On user input script is executed before the changed data is persisted in the database.

Syntax

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

Examples

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;
      }
      }

     

Related Links

Tips & Tricks -> Dynamically Adding Items to a Picklist
Tips & Tricks -> Creating a Simple Store app