Hide and Show
The deluge Hide/Show keyword is used in On user input field action script and On load form action script to hide/show a form field. Introducing a script to hide a field disallows that field from being visible to the shared users as well as the owner or administrator of the application. The Show keyword enables you to make the hidden field visible in the form.
- Hide/Show functions cannot be applied to Formula fields using Deluge.
hide <field name>;
show <field name>;
To hide/show a field a form:
- Invoke the Script Builder.
- Select the required Form/Field action.
- Drag-n-drop the Hide/Show task from the left-side task tree. The Hide/Show pop-up appears.
- Select the function Hide to hide a field or Show to show a field which is already hidden.
- Select the required field from the Select Field Name dropdown.
- Click Done to add the script.
Refer the topic Using Script Builder for detailed steps to invoke the script builder and add the script.
The following code added to the On Add - On Load block of the Form will hide the fields named Activity2 and Activity3 when the form is loaded.
- The following code is added to the On User Input block of the field named activities and will be executed when this field value is changed. The fields that were previously hidden during form load will be displayed based on the value entered in this field.
if (activities >= 2)
if (activities >= 3)
- The following sample code is added to the On User input block of the Medical_Profession field. It will display the field named Medical_Profession_Type only when the Medical Professional checkbox field is selected.
- The following script is added to the Form Actions - On add - On Load block of a Form. The script will be executed when the Form is loaded to add a record. It will hide the form fields when the form loads after 01-Jan-2007 and will display the message “Registration is CLOSED!”
if (zoho.currenttime > ‘01-Jan-2007 00:00:00?)
set showmessage = “Registration is CLOSED!”;
- The following On edit ->On load script will restrict access to all your shared users to edit only specific fields in your form. The script will be executed when a form is loaded for editing. The "If" statements will be executed if the login user is not the admin user.on edit
if (zoho.loginuser != zoho.adminuser)
- The sample code given below will hide the field named “Name” if the currenttime is past 5.00 pmhr =zoho.currenttime.toString(“HH”).toLong();
sec = zoho.currenttime.toString(“ss”).toLong();
If ( hr >= 17 &&min >0 &&sec >0)