Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7079029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:37:14+00:00 2026-05-28T06:37:14+00:00

I asked this question <input type="hidden" functionality issue a couple of days ago and

  • 0

I asked this question <input type="hidden" functionality issue a couple of days ago and was basically told its a mess your doing it wrong and style it properly. Thing is i dont know how so ill ask the same question a different way. I ask again cause im about 10hrs into this now, and no closer to a solution.

I want to add a form function that gets the information. Say

<form action="" method="get">

My belief is i have to add an input tab somewhere to actually get the info

<input type="....

And round it off with

<input type="submit" value="submit">
</form>

to submit it.

How do i incorporate this into the below code to add the functionality without losing the style. I havent add style/css section as i didnt think it would it matter to the question at hand.

<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>Both sexes</span></a>

    <ul><li><a href="#">Male<span class="value">Male</span></a>
            <a href="#">Female<span class="value">Female</span></a>
            <a href="#">Both Sexes<span class="value">Both Sexes</span></a>

    </li></ul>
  </li>
</ul>
 <input type="submit">
 </form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:37:15+00:00Added an answer on May 28, 2026 at 6:37 am

    I would have a form on the page with a single hidden field. Then I would have this menu with three choices. I would attach a javascript event handler to each item’s onclick event and in the event handler I would set the hidden field to a specific value. say, 1, 2, or 3. this field would be submitted when the user clicks the submit button.

    here is the code: http://jsbin.com/izaruv/2

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get asked this question a lot and I thought I'd solicit some input
In a related question I asked how to get input via IUP . This
I've already asked question similar to this some time ago, I thought I solved
A while ago I asked this question where I was taught to make the
A while ago I asked this question: using xslt stylesheet to convert xhtml blank
I asked this question yesterday: Compare array of words to a textarea input with
(I asked this question in another way , and got some interesting responses but
I asked this question before, Here however I think I presented the problem poorly,
I asked this question a while back but now I'm looking to implement an
I asked this question: Serial Port (rs232) in Mono for multiple platforms and this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.