focus people picker field

rss

Posted by coresoul - Mar 30 ’15 at 12:39

how to i focus to people picker field on submit if that field is mandatory and left blank?

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 5 years 10 months 26 days
    #1 by Dmitry Kozlov Mar 30 ’15 at 10:19

    Please, set Render property of the field in Client in the Forms Designer. Next, you can use the following code to set focus to the field:

    fd.field('FieldName').control()._el().find('.sp-peoplepicker-editorInput').focus()
  • coresoul
    Member
    Member for: 4 years 5 months 22 days
    #2 by coresoul Mar 30 ’15 at 10:33

    [#1]: else if (fd.field('Project_x0020_Manager').value().dictionaryEntries.length == 0) {

    alert('Please, fill in the Project Manager field.');

    $('#fd_tabcontrol-0').tabs('option', 'active', 0);

    fd.field('Project_x0020_Manager').control()._el().find('.sp-peoplepicker-editorInput').focus();

    return false;

    }

     

    Am i doing something wrong?

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 5 years 10 months 26 days
    #3 by Dmitry Kozlov Mar 31 ’15 at 04:58

    [#2]: Hi,

    If you use People Picker field in the client-side rendering mode, please, check whether it is empty with the following code:

    fd.field('User').value().length == 0

    http://formsdesigner.blogspot.com/2013/04/getting-and-setting-sharepoint-form.html

Displaying 1 to 3 of 3 messages