Focus on Text Field
Posted: 10 Nov 2014
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();
}
} )
$('.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();
}
} )