Okay
  Public Ticket #926472
Select box
Closed

Comments

  •  2
    george started the conversation

    Hi, i am trying to add a <select> box with some items in my website. for example:
    Quantity [   1,2,3,4... ]  which would be a select box.  

    In mobile, tablets, etc. (actually in responsive design didn't work).

    http://demo.neontheme.com/forms/advanced/     


    Can you help me with this issue?? 

    Thanks

  • [deleted] replied

    Hi George,

    In order to automatically initialize a selectbox (for example Select2 plugin) add the select box with this markup:

    <select name="quantity" class="select2" data-placeholder="Quantity">
    <option></option>
    <optgroup label="Quantity">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
    </optgroup>
    </select>

    And if you insert the field after the page is loaded with AJAX you can initialize it with jQuery:

    jQuery( '#element' ).select2( {...} );
    I hope this will help you.