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

160
Views
Functional only Jquery (without Select2 and Bootstrap)?

Comment form for WordPress.

A lot of code is loaded because of one single functionality. This is not good at all.

Is there an alternative to the native jQuery?

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>

   
<form id="contactForm1" action="https://exsample.com/wp-json/wp/v2/comments/" method="post">
    Name : <input name="author_name" value=""> <br> 
    E-mail : <input name="author_email" value=""> <br>
    ID post: <select name="post" class="form-control pronamic-wp-posts-example"></select> <br>
    Comment : <textarea name="content" id="" cols="30" rows="10"></textarea>
        <button>Send</button>
    </form>
    
    <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.css'>
    <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.1/css/select2.css'>
    
    <script src='https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.1/js/select2.full.js'></script>
    
    <script>
    jQuery( document ).ready( function( $ ) {
        $( '.pronamic-wp-posts-example' ).select2( {
            allowClear: true,
            minimumInputLength: 3,
            ajax: {
                url: 'https://exsample.com/wp-json/wp/v2/posts',
                dataType: 'json',
                data: function ( params ) {
                    return {
                        search: params.term
                    };
                },
                processResults: function( data ) {
                    return {
                        results: jQuery.map( data, function( obj ) {
                            return { id: obj.id, text: obj.title.rendered };
                        } )
                    }
                }
            }
        } );
    } );
    </script>

Sorry for my English.

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!