Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

93
Views
jQuery Validation doesn't work in AutoComplete Dropdown

I am using autocomplete dropdown by following this below link,

https://www.jqueryscript.net/form/tags-autocomplete-dropdown.html

Following is my code,

<div class="pf-field">
     <input type="text" id="categories" name="categories" class="tags_input">
</div>

<script>
    $(function(){
    var data = [
        'History',
        'Civics',
        'Geogpraphy',
        'Science',
        'Economics',
        'Arts',
        'Chemistry',
        'Mathematics',
        'Language',
        'Computer',
    ];

    $(".tags_input").tagComplete({

                keylimit: 1,
                hide: false,
                autocomplete: {
                    data: data
                }
        });
});
</script>

But jQuery Validation is not working on it's input field.

$(function(){
    var $profile = $('#profile');
    if($profile.length){
        $profile.validate({
            errorElement: 'span',
            rules:{
                categories:{
                    required: true
                }

            },
            messages:{
                categories:{
                    required:'Categories are mandatory!'
                }
            }
        })
    }
})

However if I remove class="tags_input" from input field then it starts working..

Can anyone help me out ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!