Jump to content
  • 0

Use Display Only Fields on Rules


taylorswiftlover
 Share

Question

Hi Everyone!
 
I am creating a Details Page and I want to use some Rules in it. However, I am not able to select the fields that I want inside the Rules. I've been looking into this article: https://howto.caspio.com/datapages/forms/conditional-forms/
 
Have been working for hours only to find out that I can not use rules if my Form Element is display only. I need to use these Rules but I don't want them to be editable. Any idea how to do this?
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hey @joneslovescaspio, are you using the Display Only fields for Criteria or Action portion of the Rule? 

I think if you are using the Display Only fields in the Action portion, you can wrap the field in Sections (use the insert button on the bottom of the wizard and insert new section). Then, instead of doing the action of the rule on the display field, just do it on the section its in. 

Link to comment
Share on other sites

  • 0

Hi @joneslovescaspio,

As mentioned on the Article, we have Action Limitations on our Rules.

Action Limitations

Note that only standard editable fields may be used in Actions, and the following cannot be used:

  • Required fields
  • Display Only fields
  • Calculated Value fields
  • Section with Required fields
  • The same field or section already used in another Action
  • Calculated Fields, CAPTCHA, and Distance Search fields
  • HTML Blocks
  • Hidden or smart fields (Timestamp, AutoValue, ViewIncrement)
  • Static action on Password fields
  • Secondary field used in multiple search criteria (such as in Date Range)

 

That being said, you should make the Form Element to "Text Field" so that you can use this on the rules.

We have two workarounds on how to make the fields non-editable.

1.) CSS You can use the 'pointer-events: none' CSS.

For example, you don't want all the text fields to be edited. You can use this CSS code:

<style>
input[class*="cbFormTextField"]{
pointer-events: none;
}
</style>

If you want to be specific on the fields, you can change them to

<style>
input[id*="EditRecordFirstName"]{
pointer-events: none;
}
</style>

This, however, if a user clicks on Tab, the field may be editable.

 

Another option is to create using JavaScript.

This is the simplest I can create (I'm not an expert on this, but I'll try anyway)

<script>
document.getElementById("INSERT ELEMENT ID").readOnly= true;
</script>

Just need to insert the ID of the Text boxes that needs to be non-editable. 

Anyone else who can suggest to improve the JS?

Since, on this JS, you should need to declare all the fields that needs to be non editable. Hehe. That's the easiest way I know, but it's working. 

 

I hope this helps.

Glitch

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...