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 8903543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:53:45+00:00 2026-06-15T01:53:45+00:00

I have a question and I searched on how to solve this problem, but

  • 0

I have a question and I searched on how to solve this problem, but I found something easy and similar to what I want, it would be the following:

I need a form where the user to select an option in a combobox form fields change.

eg:
selects option 1
Field 1, Field 2 and Field 3 are displayed to fill
selects option 2
Field 4, Field 5 and Field 6 appear to fill

And when submit identifies himself was filled fields of option 1 or option 2

Sample HTML:

<select id="option_selector" name="options">
    <option value="option1">Option 1</option>
    <option value="option2">Option 2</option>
</select>
<div id="options">
    <div id="option1">
        <input type="text" name="input1" value="Input 1" />
        <input type="text" name="input2" value="Input 2" />
        <input type="text" name="input3" value="Input 3" />
    </div>
    <div id="option2">
        <input type="text" name="input4" value="Input 4" />
        <input type="text" name="input5" value="Input 5" />
        <input type="text" name="input6" value="Input 6" />
    </div>
</div>

Anyone know any tutorial or can point me what should I do?

thanks

  • 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-15T01:53:47+00:00Added an answer on June 15, 2026 at 1:53 am

    Did something like this recently at work. This will do what you want.

    I made it so that the name of the select matches up to the id of the option div, and the values of the options match up to the ids of the individual section wrappers.

    That way, you could slightly alter it to work with multiple optional-selects on a single page.

    Demo Here: http://jsfiddle.net/GUCtC/

    <select id="option_selector" name="options">
        <option value="option1">Option 1</option>
        <option value="option2">Option 2</option>
    </select>
    <div id="options">
        <div id="option1">
            <input type="text" name="input1" value="Input 1" />
            <input type="text" name="input2" value="Input 2" />
            <input type="text" name="input3" value="Input 3" />
        </div>
        <div id="option2">
            <input type="text" name="input4" value="Input 4" />
            <input type="text" name="input5" value="Input 5" />
            <input type="text" name="input6" value="Input 6" />
        </div>
    </div>
    <script type="text/javascript">
            $('#option_selector').change(refresh_inputs);
            refresh_inputs();
            function refresh_inputs() {
                var name = $('#option_selector').attr('name');
                var val = $('#option_selector').val();
                $('#'+name+' div').hide();
                $('#'+val).show();
            }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched and found another with quite close question but the result was
I realize this is a basic question but I have searched online, been to
i have got this question to solve from one my friends. i have searched
In advance, I have searched for a solution to this problem already but there
this is my first question I have searched for any launching activity questions and
I have searched for hours for the answer to my question and have found
I have searched stackoverflow for a question like mine but most of the questions
I have searched here, GooBingHooVista'd the world and read this related question for VS
I have searched for an answer but couldn't find it anywhere. My question is
I asked this question earlier and I have been reading the answers and searched

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.