Note that there are some explanatory texts on larger screens.

plurals
  1. POIssues Setting Value/Label Using DropKick Javascript
    primarykey
    data
    text
    <p>I've been using a nice, elegant plugin called DropKick for my webapp <a href="http://jamielottering.github.com/DropKick/" rel="noreferrer">http://jamielottering.github.com/DropKick/</a>, and I seem to be having a slight issue with it and am not sure how to go about trying to fix it. I am trying to programmatically change the value of the select drop down menu. Below is a description of my issue, and a link to JSFiddle.</p> <p><strong>HTML:</strong></p> <pre><code>&lt;select id="start" class="timePreference"&gt; &lt;option value="Choose"&gt;Choose&lt;/option&gt; &lt;option value="1"&gt;1&lt;/option&gt; &lt;option value="2"&gt;2&lt;/option&gt; &lt;option value="3"&gt;3&lt;/option&gt; &lt;option value="4"&gt;4&lt;/option&gt; &lt;option value="5"&gt;5&lt;/option&gt; &lt;option value="6"&gt;6&lt;/option&gt; &lt;option value="7"&gt;7&lt;/option&gt; &lt;option value="8"&gt;8&lt;/option&gt; &lt;option value="9"&gt;9&lt;/option&gt; &lt;option value="10"&gt;10&lt;/option&gt; &lt;option value="11"&gt;11&lt;/option&gt; &lt;option value="12"&gt;12&lt;/option&gt; &lt;/select&gt; </code></pre> <p><strong>jQuery:</strong></p> <pre><code> $('.timePreference').dropkick(); $('#someDiv').click(function() { $('#start').val("1"); alert($('#start').val()); ); </code></pre> <p>When I show the value in alert, it shows as one, however when I look at the labels on the option it stays at the default or whatever it was prior to the change. </p> <p>For example, if my default was "Choose" and I click someDiv, then alert will show "1", so it changing, but the select dropdown will still show "Choose". Any suggestions. I may just be missing something small, not sure.</p> <p>FSFiddle: <a href="http://jsfiddle.net/kdp8791/aNS9R/61/" rel="noreferrer">http://jsfiddle.net/kdp8791/aNS9R/61/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload