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

Question

Question

URL Linking into Read-Only fields

asked on February 23, 2016

Using the ro attribute in the JavaScript to make a field read-only and using URL link to populate the read only field. The issue we are running into is that when the values are passed to the form and the field is the first field on the form, the cursor selects the first field and allows for me to change the value. Has anyone ran into this before and resolved?

 

Javascript

$(document).ready(function () {
   $('.ro input').attr('readonly','True');
   $('.ro select').attr('readonly','True');
});

0 0

Replies

replied on February 23, 2016 Show version history

Steven,

Try using "prop" instead of "attr" to see if that clears up the issue (and remove single quotes around true):

$(document).ready(function () {
   $('.ro input').prop('readonly',true);
   $('.ro select').prop('readonly',true);
});

 

0 0
replied on February 24, 2016

Wes,

Thanks for the response. I still see the same interaction if I use prop. 

When testing under the preview of forms, the form loads I can start typing in the first read only field. If I tab out or click of the field it then becomes read only. 

Thanks

0 0
replied on February 24, 2016

Which version of Forms are you using?

0 0
replied on February 24, 2016

9.2.1.1088

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

Sign in to reply to this post.