Note that there are some explanatory texts on larger screens.

plurals
  1. PO<input type="hidden" functionality issue
    primarykey
    data
    text
    <p>Iv'e got a split menu system using javascript. Because im requesting information, im using the input tags. </p> <p>I dont want checkboxes, textboxes, radio butons etc interfering with the design. So i tried the hidden input type. Keeps the design, but keeps reverting back to female, or the first one on the list, if nothing was selected. For example. I select male and submit. Male selection enters my code. Now, i do something else and click submit, and the below code reverts back to female with out me say so. It dosent do thise with check or radio, so why does it do this with "hidden". </p> <p>Also, what input type should i use if i dont want to upset function or design, or how else can i go about this. </p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $(".dropdown a").click(function() { $(".dropdown ul").toggle(); }); }); $(".dropdown ul li a").click(function() { var text = $(this).html(); $(".dropdown a span").html(text); $(".dropdown ul").hide(); $("#result").html("Selected value is: " + getSelectedValue("sample")); }); function getSelectedValue(id) { return $("#" + id).find("li a span.value").html(); } $(document).bind('click', function(e) { var $clicked = $(e.target); if (! $clicked.parents().hasClass("dropdown")) $(".dropdown ul").hide(); }); }); &lt;form action="" method="get"&gt; &lt;div class="sort"&gt; &lt;ul&gt; &lt;li id="sample" class="dropdown"&gt; &lt;a href="#"&gt;Gender |&lt;span&gt;{{ gender }}&lt;/span&gt;&lt;/a&gt; &lt;ul&gt;&lt;li&gt;&lt;a href="#"&gt;&lt;input id="radio1" name="Gender" value="Female"/&gt;Female&lt;/a&gt; &lt;a href="#"&gt;&lt;input id="radio2" name="Gender" value="Male"/&gt;Male&lt;/a&gt; &lt;a href="#"&gt;&lt;input id="radio3" name="Gender" value="Both Sexes"/&gt;Both Sexes&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    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