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

Discussions about Forms Designer for SharePoint 2010.
Locked
Arnel Tolentino
Posts: 6
Joined: Sat Jun 01, 2013

08 Jul 2013

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

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

08 Jul 2013

Hello Arnel,

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

Image

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

08 Jul 2013

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

Arnel Tolentino
Posts: 6
Joined: Sat Jun 01, 2013

08 Jul 2013

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

Arnel Tolentino
Posts: 6
Joined: Sat Jun 01, 2013

08 Jul 2013

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

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

09 Jul 2013

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

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

09 Jul 2013

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/

Arnel Tolentino
Posts: 6
Joined: Sat Jun 01, 2013

09 Jul 2013

Yes, it seems to be working now. Maybe it just need some time to propagate thats why it doesnt work before.

Thanks,

Arnel

Arnel Tolentino
Posts: 6
Joined: Sat Jun 01, 2013

09 Jul 2013

Thanks! It works. :D

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests