You are viewing limited content. For full access, please sign in.

Question

Question

Forms 10.4.5.282 allowing users to change value of readonly select fields?

asked on June 3, 2021

Anyone notice they are able to change read only select type fields in this specific version of forms?

You can clearly see it is read-only by the background color, but I can select any select type filed and pick a new value.

0 0

Answer

SELECTED ANSWER
replied on June 3, 2021

You're using the wrong attr for slect elements, you should actually be setting the disabled property.

$('.classname select').attr("disabled", true); 

 

1 0
replied on June 3, 2021

Well this worked! I have been using the readonly attribute for years on any type of field thinking it meant the user can only read the data, not write the data.

Thank you!

 

 

0 0
replied on June 3, 2021

You're welcome! Glad I was able to help! 

 

PS. The same type of deal applies to radio buttons, but you'll want to target the 'fieldset' element.

$('.classname fieldset').attr('disabled',true)

 

 

0 0
replied on June 3, 2021

Oh I was using this method for radio

$('.conRead input:not(:checked)').attr('disabled', true);

 

1 0
replied on June 3, 2021

That works too! Essentially the same thing, just wanted to be sure you knew to use the disabled attr. Cheers!

0 0

Replies

replied on June 3, 2021

Can you do this on the actual form? It looks like you are on the CSS/JS page. 

0 0
replied on June 3, 2021

Yes, both in production within the user task and in preview. First I have ever run into this.

0 0
replied on June 3, 2021

How did you set the field to read only? (Field level/section level/form level)

If you change the value to something else, can you submit the form? Does it pass backend validation? If you go to monitor, does the value actually get updated? 

0 0
replied on June 3, 2021

I am setting to read only using this line of script. Field rules do not yet support read/write in the modification options, I believe script is the only way to do it and I have been doing this for years without issue.

$('.className select').attr('readonly',true);

I just tested changing it from the task where it is read-only, and on the next task it is changed in the history and in the current forms variables.

0 0
replied on June 3, 2021

Is this happening to your other forms where you used this? Or just this one form? 

The readonly attribute should be supported by all browsers, but it could be a browser specific issue. Have you tried other browsers as well? 

0 0
replied on June 3, 2021

It works on all other forms running on any other version. I just tested on a brand new form under this version and same problem, also just tested using Edge instead of Chrome and it is the same.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.