Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to retrieve selected drop-down values from external plugin?
    text
    copied!<p>I'm using <a href="http://www.givainc.com/labs/mcdropdown_jquery_plugin.cfm" rel="nofollow">plugin</a> from drop-down, all is set, except I cannot get values of drop-down items as they are selected.</p> <p><strong>HTML</strong></p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;script type="text/javascript" src="lib/jquery-1.2.6.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="lib/jquery.mcdropdown.js"&gt;&lt;/script&gt; &lt;!---// load the mcDropdown CSS stylesheet //---&gt; &lt;link type="text/css" href="css/jquery.mcdropdown.css" rel="stylesheet" media="all" /&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Untitled 1&lt;/title&gt; &lt;style type="text/css"&gt; div.test &gt; div { float: left; width: 108px; margin-right: 40px; } div.mcdropdown { width: 110px; } ul.mcdropdown_menu { float: left; width: 110px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;ul id="categorymenu" class="mcdropdown_menu"&gt; &lt;li rel="1"&gt;Arts &amp;amp; Humanities &lt;ul&gt; &lt;li rel="2"&gt;Photography &lt;ul&gt; &lt;li rel="3"&gt;3D &lt;/li&gt; &lt;li rel="4"&gt;Digital &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li rel="5"&gt;History &lt;/li&gt; &lt;li rel="6"&gt;Literature &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li rel="7"&gt;Business &amp;amp; Economy &lt;/li&gt; &lt;li rel="8"&gt;Computers &amp;amp; Internet &lt;/li&gt; &lt;li rel="9"&gt;Education &lt;/li&gt; &lt;li rel="11"&gt;Entertainment &lt;ul&gt; &lt;li rel="12"&gt;Movies &lt;/li&gt; &lt;li rel="13"&gt;TV Shows &lt;/li&gt; &lt;li rel="14"&gt;Music &lt;/li&gt; &lt;li rel="15"&gt;Humor &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li rel="10"&gt;Health &lt;/li&gt; &lt;/ul&gt; </code></pre> <p><strong>SCRIPT</strong></p> <pre><code>function check() { var mc= $("#category").mcDropdown(); alert(mc.getValue()); } &lt;/script&gt; </code></pre> <p>According to doc <code>When a user selects an item from the menu, it is this value that is placed in a hidden element and therefore passed back to the server when the form is submitted.</code>, I want to know the value of selected item, but the js only gives me rel number in integer no value, how can I get values or I can self post on submit button to a function where I can see how these values are being sent. </p> <p>THANKS.</p>
 

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