Hi Priya Chohan​,
The following JavaScript code can be used to set the focus on a people picker field with a field name "User". The Javascript code must be added to the form settings > Custom Javascript.
NWF.FormFiller.Events.RegisterAfterReady(function () {
   NWF$(document).ready(function(){ Â
       NWF$("divÂdata-controlname='User'] textarea").focus();
   });
});
Cheers,
Rick
Please mark this reply as a correct answer if it answers your question because this helps the community.
Rick is right - more information and examples You will find in Â
Hi Rick,
I want to add the focus to a date/time field, i have looked at the below link from Manfred lauer and saw the script for date/time but it didnt work the focus was still on the 1st field on the form.
The field in question is a sharepoint column does that make any difference.
Here is a screen shot of the form, the cursor appears where its says 16/17 but I want it to appear at Created: field which is a date field.
Thanks for your help in advance
Priya
Hi Manfred,
I have looked at the examples on javascript events in nintex forms and i am using the date/time example but its not working for my form, would it be because the script only works for new items entered into the list like it says on the example
"When you add a new item, you should notice that the initial focus of the form has changed, and it is now occurring in the Date/Time control."
Â
I don't have new items in the list the items have already been created, data is being held within the list for each item.
Any ideas why the cursor would not be moving to the date/time field ?
regards
Priya
Hi Priya,
What event do You have used and how does jquery selector for the date/time control looks like, who is date/time control configured
Kind regards
Manfred
here is the ccs class for my date/time field
and I am using the following script in custom javascript in form settings
Hope this explains it.
Thanks in advance
Priya
Please try following script to set cursor to control in line 1 of repeating section:
NWF.FormFiller.Events.RegisterAfterReady(function ()
{
 NWF$(NWF$('.datetimeFocus input.nf-date-picker'))1]).focus()
});
Aahhhh thank you so much Manfred that has worked and done the job.
I can't believe all it was to add in the number 1 after the nf.date.picker I guess that is because i have several fields related to nf.date.picker hence it wasn't working correctly.
Thanks again
Priya