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

  • SEARCH
  • Home
  • 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 8286715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:51:11+00:00 2026-06-08T11:51:11+00:00

I want to be able to allow users to add their own options on

  • 0

I want to be able to allow users to add their own options on an HTML select dropdown. I have most of the code written except for the part where it takes the value and create an “option” under the select menu.

HTML

<li id="add_1_parent">
    <div>
        <select width="100" class="add_select add_referral">
            <option value="">Incorporation</option>
            <option value="">Corporation</option>
            <option value="">Limited Liability Corporation</option>
            <option value="">Sole Proprietor</option>
        </select>
        <a href="#" id="add_1_child">Add</a>
    </div>    
</li>

JS

$(document).ready(function() {
    $('#add_1_child').click(function() {
        $('#add_1_parent').append('<input id="add_1_foster_add" class="add_input" type="text" size="50" class="" value="" maxlength="255"/><a href="#" id="add_1_foster_child">Add</a>');
    });
    $('#add_1_foster').click(function() {
        // Add the value to the select HTML here..?
    });
});

http://jsfiddle.net/HWRWv/

When you click the "Add" button, it needs to show a text box.

When you click the second add as defined by "add_1_foster_child" it needs to take the value out of the input, turn it into an <option> under the select menu.

What I don’t know how to do is to grab the value from the input and put it into the select menu.

  • 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-06-08T11:51:13+00:00Added an answer on June 8, 2026 at 11:51 am

    I’m guessing this is what you’re after :

    $(document).ready(function() {
        $('#add_1_child').on('click', function() {
            var html = '<div class="add_container"><input class="add_input" type="text" size="50" maxlength="255"/><a href="#" class="add_link">Add</a></div>';
            $('#add_1_parent').append(html);
        });
    
        $('#add_1_parent').on('click', '.add_link',function() {
            var option = $('<option value="">'+$(this).prev('.add_input').val()+'</option>');
            $('.add_select').append(option);
            $('.add_container').remove(); //removes the add input after submission, optional ?
        });
    });​
    

    FIDDLE

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

Sidebar

Related Questions

I have a Drupal site where I want to allow users to add their
I'm building an app where I want to allow users to be able to
I am building a Flash site and I want to be able to allow
I want to be able to edit and delete resources myself, but not allow
I want to be able to take an image that i have already captured
I have a class with various public properties which I allow users to edit
I want to allow some trusted users to scp files into my server (to
I want to make an app that allows users to add other users to
we're looking at add a new feature to our site which would allow users
I do not want new users to be able to sign up. So in

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.