none
Make person and group fields manfdatory using javascript RRS feed

  • Question

  • Hi

    Since client needs all clien side validations, we need to make 'person and group' field manfdatory using javascript,

    please help doing that.

    Thanks

    Paru

    Thursday, November 19, 2015 12:01 PM

Answers

All replies

  • Hi Paru,

    Are you talking about a "Person and group" field as a site/list column? If yes you don't have to use any JavaScript for it.

    Go to Site Columns from site settings, click on the field name. In "Requires that field contains information", click on yes.

    Same for list column.

    Please let us know if this helps.




    • Edited by ViviSP Thursday, November 19, 2015 2:17 PM
    Thursday, November 19, 2015 2:17 PM
  • Hi Paru,

    If you want to achieve the validation using JavaScript, you can take use of the built in function PreSaveAction() and put the validating logic there.

    Here is a demo about how to perform validation using PreSaveAction() method for your reference:

    https://deannaschneider.wordpress.com/2012/12/03/sp2010-using-presaveaction-on-custom-forms/                

    Thanks

    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Friday, November 20, 2015 8:18 AM
    Moderator
  • Thanks for the answer, it works :)
    Friday, November 20, 2015 8:35 AM
  • Hi,

    If my reply helps you, please mark the reply as answer to close this case.

    Thanks,       

    Patrick Liang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Monday, November 23, 2015 1:26 AM
    Moderator