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

Question

Question

How to make a multi-line field read only through javascript?

asked on February 15, 2017

I am using 

$('.ro input').attr('readonly', true);

to make multiple fields read only which works perfectly until it encounters a multi-line field. All other fields are made read-only except the multi-line fields. Is there a specific way to target multi-line fields?

0 0

Answer

SELECTED ANSWER
replied on February 15, 2017

Multi-line fields are textareas, not inputs. Try

$('.ro textarea').attr('readonly', true);
4 0
replied on February 15, 2017

Thank you sir.

0 0

Replies

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

Sign in to reply to this post.