function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Srinivasa Amarendra Reddy VakaSrinivasa Amarendra Reddy Vaka 

how to autotab to a next field once the max length reached in Javascript

Hi

I have 4 textboxes like credit card number boxes. They all have different max lengths.

I have coded the below in the controller component but it is not working. Can you please suggest what I am doing wrong?

if (cmp.Find("offerCodePart1").length == cmp.Find("offerCodePart1").maxLength){
cmp.Find("offerCodePart2").focus();
}

Regards
Amar
AbhinavAbhinav (Salesforce Developers) 
Hi Srinivasa,

Could you share some detail code snippet so that we can replicate the thing on our end.

Thanks!