Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Maximum Call stack Exceeded in jQuery Autocomplete

I’m facing the problem in jQuery autocomplete if I used focus() method inside my jQuery autocomplete then it throws maxim call stack exceeded and sometime I couldn’t clear what I’m typed in the input type also. my code looks like

onSelect: function (output) {   
  $("#studentID").val(output.data);    
  $('#StudentName').focus(); 
},

If I comment the focus() method then there is no errors will happen, I have the validation of this field that validation only removed by focus() method

If I comment the focus() method then there is no errors will happen, I have the validation of this field that validation only removed by focus() method

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Maximum call stack error could not be thrown thats my only concern

>Solution :

Try this – never focus something that may trigger something on focus

onSelect: function (output) {   
  $("#studentID").val(output.data);    
  setTimeout(() => $('#StudentName').focus(),10); 
},
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading