Page 1 of 1

How to display field as read-only or hide it in a form?

Posted: 08 Jul 2013
by Arnel Tolentino
Hi Everyone,

How can I display these fields as read-only in a form and how can I hide them as well?

1. Single line of text.
2. Date and Time.
3. Choices.
Thank You,

Arnel

Re: How to display field as read-only or hide it in a form?

Posted: 08 Jul 2013
by Dmitry Kozlov
Hello Arnel,

You have to set ReadOnly property of the fields to True:

Image

Re: How to display field as read-only or hide it in a form?

Posted: 08 Jul 2013
by Dmitry Kozlov
If you wish to hide them, just do not put them into the form with Forms Designer. If you wish to hide them dynamically based on other field values, please, visit this thread: viewtopic.php?f=4&t=26

Re: How to display field as read-only or hide it in a form?

Posted: 08 Jul 2013
by Arnel Tolentino
Hi,

Yes, I already try that but its only showing blank field. I have a default value for this Date and Time field (Today's date) now its totally gone. I just wanted to make this read only so users wont be able to change it.


Thank You,


Arnel

Re: How to display field as read-only or hide it in a form?

Posted: 08 Jul 2013
by Arnel Tolentino
Just to confirm regarding this code below. Which part should I replace for the info of my field?

$('.fd_field[fd_name="V3Comments"]').hide();

Thank You,

Arnel

Re: How to display field as read-only or hide it in a form?

Posted: 09 Jul 2013
by Dmitry Kozlov
Hello Arnel,

I created a new Custom list, added Date and Time field and set default value to Today's Date in its properties:

Image

Then I put this field into the form and set ReadOnly property to 'True':

Image

Saved these changes for all types of form:

Image

Here is my New form:

Image

Re: How to display field as read-only or hide it in a form?

Posted: 09 Jul 2013
by Dmitry Kozlov
You have to replace V3Comments with an internal name of your column.

You can read the following article to see how to get internal names of SharePoint columns: http://www.idubbs.com/blog/2012/finding ... t-columns/

Re: How to display field as read-only or hide it in a form?

Posted: 09 Jul 2013
by Arnel Tolentino
Yes, it seems to be working now. Maybe it just need some time to propagate thats why it doesnt work before.

Thanks,

Arnel

Re: How to display field as read-only or hide it in a form?

Posted: 09 Jul 2013
by Arnel Tolentino
Thanks! It works. :D