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

131
Views
live search add a href to results

I have a live search in laravel 7 everything works good but I cant add (href a tag) to result list because result show in select option (select2 library) without (a) tag and cant be open in a new page for see result for this keyword

my blade:

   <div class="fre-search-wrap">
      <select class="livesearch form-control" name="Find Consultants"></select>
   </div>

my scripst:

<script type="text/javascript">
$('.livesearch').select2({
    placeholder: 'Select Consultants',
    ajax: {
        url: '/live_search/action',
        dataType: 'json',
        delay: 550,
        processResults: function (data) {
            return {
                results: $.map(data, function (item) {
                    return {
                        text: item.title,
                        id: item.id
                    }
                })
            };
        },
        cache: true
    }
});

the main source was this https://www.positronx.io/laravel-autocomplete-search-with-select2-example/

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Hello guy you can use this to add a tag:


$('.livesearch').select2({
    placeholder: 'Select Consultants',
    ajax: {
        url: '/live_search/action',
        dataType: 'json',
        delay: 550,
        processResults: function (data) {
            return {
                results: $.map(data, function (item) {
                    return {
                        text: ""+item.title+"", // a tag
                        id: item.id
                    }
                })
            };
        },
        cache: true
    }
});
about 4 years ago · Juan Pablo Isaza Report
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!