Iv'e got a split menu system using javascript. Because im requesting information, im using the input tags.
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".
Also, what input type should i use if i dont want to upset function or design, or how else can i go about this.
<script type="text/javascript"> $(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(); }); }); <form action="" method="get"> <div class="sort"> <ul> <li id="sample" class="dropdown"> <a href="#">Gender |<span>{{ gender }}</span></a> <ul><li><a href="#"><input id="radio1" name="Gender" value="Female"/>Female</a> <a href="#"><input id="radio2" name="Gender" value="Male"/>Male</a> <a href="#"><input id="radio3" name="Gender" value="Both Sexes"/>Both Sexes</a> </li></ul> </li> </ul>