Follow

Setting a Field as Read Only

Within the Capriza Designer, it is possible to render controls that are interactive in the source application, such as text inputs, lookups, etc., as read only fields. This feature enables you to further simplify workflows for an enhanced user experience. For example, this source application for entering Purchase Orders has a date input field. However, entering anything but today's date (default value) will trigger an error. 

 

Screen_Shot_2017-06-06_at_10.08.56_AM.png

 

To save the user the wasted time of potentially running into an error, you can make the date field read only on mobile.

 

First, the required page elements.

 

Screen_Shot_2017-06-06_at_10.09.41_AM.png

 

Click the wrench icon to open the Web Properties dialog for the control you would like to make read only.

 

Read_Only_Wrench.png

 

Navigate to the "Properties" tab and scroll to the "Monitor Read Only State" section.

 

Monitor.png

 

Change the retrieval method to "Override."

 

Screen_Shot_2017-06-06_at_10.18.23_AM.png

 

A textbox to enter JavaScript code will appear. Specify the conditions under which the control should be rendered Read Only. For example, to render the control read only any time it is on the page, you could use the following code: 

 

if (element.style.visibility = true) element.readOnly = true;

 

Screen_Shot_2017-06-06_at_11.53.07_AM.png

 

Close the dialog. The field is now read only in the mobile preview.

 

Screen_Shot_2017-06-06_at_11.53.23_AM.png

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.