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

rss

Posted by Arnel Tolentino - Jul 8 ’13 at 11:35

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

  • Dmitry
    Dmitry
    Admin
    Member for: 7 years 6 months 2 days
    #1 by Dmitry Jul 8 ’13 at 12:54

    Hello Arnel,

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

    SharePoint Form readonly field

  • Dmitry
    Dmitry
    Admin
    Member for: 7 years 6 months 2 days
    #2 by Dmitry Jul 8 ’13 at 12:58

    [#1]: 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: http://forum.spform.com/forms-designer/set-a-field-to-invisible-through-script-53/

  • Arnel Tolentino
    Member
    Member for: 6 years 5 months 5 days
    #3 by Arnel Tolentino Jul 8 ’13 at 01:19

    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
    Member
    Member for: 6 years 5 months 5 days
    #4 by Arnel Tolentino Jul 8 ’13 at 01:31

    [#2]: 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

  • Dmitry
    Dmitry
    Admin
    Member for: 7 years 6 months 2 days
    #5 by Dmitry Jul 9 ’13 at 02:10

    [#3]: Hello Arnel,

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

    SharePoint field default value

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

    SharePoint readonly field

    Saved these changes for all types of form:

    Save all forms with SharePoint Forms Designer

    Here is my New form:

    SharePoint New form

  • Dmitry
    Dmitry
    Admin
    Member for: 7 years 6 months 2 days
    #6 by Dmitry Jul 9 ’13 at 02:17

    [#4]: 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-internal-names-for-sharepoint-list-columns/

  • Arnel Tolentino
    Member
    Member for: 6 years 5 months 5 days
    #7 by Arnel Tolentino Jul 9 ’13 at 08:15

    [#5]: 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
    Member
    Member for: 6 years 5 months 5 days
    #8 by Arnel Tolentino Jul 9 ’13 at 11:54

    [#6]: Thanks! It works. smile

Displaying 1 to 8 of 8 messages