Page 1 of 1

Focus on Text Field

Posted: 10 Nov 2014
by Adam Reyes
I'm trying to set a field to show when a drop down choice is selected and then focus on that text field once it is showing but I'm trouble getting the code to function properly. Perhaps there's another way of doing? Here's the code I'm using right now:


$('.suggested-field').hide();

fd.field('CSR_x0020_Incident_x0020_Categor').control().change(function()

{

var issue = fd.field('CSR_x0020_Incident_x0020_Categor').value();

if(issue=='Other')

{

$('.suggested-field').show();

$('.suggested-field').focus();

alert('Please type in a category you would suggest if you could not find an existing one.');

}

else

{

$('.suggested-field').hide();

}

} )

Re: Focus on Text Field

Posted: 11 Nov 2014
by Dmitry Kozlov
Hi Adam,

Please, try the following code to set focus on the text field:

Code: Select all

$('.suggested-field input').focus();

Re: Focus on Text Field

Posted: 11 Nov 2014
by Adam Reyes
That worked perfectly, thanks Dmitry!

Re: Focus on Text Field

Posted: 27 Mar 2015
by coresoul
how can i focus peoplepicker field?