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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:00:47+00:00 2026-06-14T21:00:47+00:00

I would like an HTML form that has a few fixed inputs, as well

  • 0

I would like an HTML form that has a few fixed inputs, as well as some dynamic ones that are selected based on an a drop-down. My goals:

  1. I would prefer this is entirely handled in the browser, rather than AJAX calls to fetch the dynamic “sub-form” portions that were selected by the drop-down.
  2. Rather than adding a 3rd party JS library, I would like to leverage the libraries that come with ASP.NET MVC4 (jquery, knockout, etc.). However, I am willing to add a 3rd party library if the former attempt is too clumsy.

What path do you recommend? Does HTML5 have any “help” for this?

Update
It occurs to me that the HttpPost of the form should not include “sub-form” values that were not chosen in the select box. What now? Store the extra div elements in an out-of-document list and swap them in as needed? Or perhaps much better, have an event attached to the submit button that deletes the unused/invisible divs before posting?

  • 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-14T21:00:49+00:00Added an answer on June 14, 2026 at 9:00 pm

    Pure javascript is perfectly capable of this. jQuery will make your life a bit easier should you go that route.

    Here’s an example of how to show different form options based on a dropdown value using jQuery:

    <form>
        <div>Are you in school?
            <select id="in_school">
                <option selected="selected">Please choose</option>
                <option value="yes">Yes</option>
                <option value="no">No</option>
            </select>
        </div>
        <div id="in_school_yes" class="in_school_input" style="display: none;">
            What grade are you in?
            <input type="text" name="grade" />
        </div>
        <div id="in_school_no" class="in_school_input" style="display: none;">
            What year did you graduate?
            <input type="text" name="graduation_year" />
        </div>
        <div>
            <button type="submit">Submit</button>
        </div>
    </form>
    
    <script>
    $("#in_school").change(function() {
        var in_school = $(this).val();
        $(".in_school_input").hide("fast", function() {
            $("#in_school_" + in_school).show("slow");
        });
    });
    </script>
    

    Fiddle: http://jsfiddle.net/RDtVZ/

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

Sidebar

Related Questions

I have a HTML form that has a selection drop down. I would like
I've got an input field on my plain html form that I would like
I would like to make a form in HTML where a user enters some
I would like to make a checkbox form that has both mouse over image
I would like to use a textarea in html form to get the delimited
I would like to use HTML 5 for video/audio viewing, but I have some
I have an html form that has the following structure: <input type=text name=title />
I have a simple form that I would like to validate on form submission.
So I have a html page that has a form, and a table inside
Years back I built a simple mail form that has been working like a

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.