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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:39:08+00:00 2026-06-10T16:39:08+00:00

I am working on creating a form section which shows input fields (either text

  • 0

I am working on creating a form section which shows input fields (either text or select fields) when a user checks the respective checkbox. The problem that I am having though is that if you have displayed the select and one of the text inputs, if you attempt to click the text field to type, it will jump focus up to the select making it impossible to type in the field.

I am using jQuery to achieve the functionality (most recent version) and am executing the following javascript code to achieve this. The HTML that goes with it is below this.

//Class Year Dropdown
$("#ifClassScholashipsSelected").css("display", "none");
$(".enableClassYearSelection").click(function() {
    if ($("input[name=Class_Scholarships]:checked").val() == "class_scholarships") {
        $("#ifClassScholashipsSelected").slideToggle("fast"); //Slide Down Effect
    } else {
        $("#ifClassScholashipsSelected").slideToggle("fast"); //Slide Up Effect
    }
});
//Other Funds Dropdown
$("#ifOtherFundsSelected").css("display", "none");
$(".enableOtherFunds").click(function() {
    if ($('input[name=OtherFunds]:checked').val() == "other_funds") {
        $("#ifOtherFundsSelected").slideDown("fast"); //Slide Down Effect
    } else {
        $("#ifOtherFundsSelected").slideUp("fast"); //Slide Up Effect
    }
});
//In Memory Of Dropdown
$("#ifInMemoryOfSelected").css("display", "none");
$(".enableInMemoryOf").click(function() {
    if ($('input[name=InMemoryOf]:checked').val() == "in_memory_of") {
        $("#ifInMemoryOfSelected").slideDown("fast"); //Slide Down Effect
    } else {
        $("#ifInMemoryOfSelected").slideUp("fast"); //Slide Up Effect
    }
});
//In Honor Of Dropdown
$("#ifInHonorOfSelected").css("display", "none");
$(".enableInHonorOf").click(function() {
    if ($('input[name=InHonorOf]:checked').val() == "in_honor_of") {
        $("#ifInHonorOfSelected").slideDown("fast"); //Slide Down Effect
    } else {
        $("#ifInHonorOfSelected").slideUp("fast"); //Slide Up Effect
    }
});​

This is having an effect on the following code :

<input type="checkbox" name="Class_Scholarships" value="class_scholarships" class="enableClassYearSelection" />
    <label><strong>Class Scholarships</strong>
<!--Dropdown if selected-->
<div id="ifClassScholashipsSelected">
    <em>Please select the appropriate class below</em></label> <br />
        <select name="SelectedClassYear">
            <option value="NoClass">Choose a Class</option>
            <option value="Class_Of_2003">Class of 2003 Scholarship IHO Ralph A. Crawley</option>
            <option value="Class_Of_2004">Class of 2004 Scholarship IMO C. Frazier 04 &amp; IHO W. Simms</option>
            <option value="Class_Of_2005">Class of 2005 Scholarship IMO Prof. Lee Cohen</option>
            <option value="Class_Of_2006">Class of 2006 Scholarship IMO Peter C. Bance Jr</option>
            <option value="Class_Of_2007">Class of 2007 Scholarship IHO Lt. Gen. Sam Wilson</option>
            <option value="Class_Of_2008">Class of 2008 Scholarship IHO Ms. Gerry Pettus</option>
            <option value="Class_Of_2009">Class of 2009 Scholarship</option>
            <option value="Class_Of_2010">Class of 2010 Scholarship IHO Mrs. Dottie Fahrner</option>
            <option value="Class_Of_2011">Class of 2011 Scholarship IHO Ms. Anita Garland</option>
            <option value="Class_Of_2012">Class of 2012 Scholarship IHO Mr. Jason M. Ferguson 96</option>
            <option value="Class_Of_1951">Class of 1951 Memorial Scholarship</option>
            <option value="Class_Of_1953">Class of 1953 Scholarship Endowment</option>
            <option value="Class_Of_1954">Class of 1954 Wilson Center Lecture Series</option>   
            <option value="Class_Of_1958">Class of 1958 Summer College Endowment Fund</option>  
            <option value="Class_Of_1960">Class of 1960 Good Men Good Citizens Scholarship</option>  
            <option value="Class_Of_1961">Class of 1961 Good Men Good Citizens Scholarship</option>
            <option value="Class_Of_1980">Class of 1980 Endowed Scholarship</option>
        </select>
    </div>
    <!--End Dropdown-->
    <br />

<input type="checkbox" name="CultureandCommunity" value="culture_and_community" />
    <label><strong>Culture and Community</strong> &mdash; Supports the arts at Hampden-Sydney and service opportunities locally and around the world.</label><br />
    <input type="checkbox" name="OtherFunds" value="other_funds" class="enableOtherFunds" />
    <label><strong>Would you like to donate to other funds?</strong></label>
        <!--Dropdown if selected-->
            <div id="ifOtherFundsSelected">
                <em>Please select the fund below</em></label> <br />
                <div class="scrolllist">
                    <input type="checkbox" name="BortzLibrary" value="1" /> Bortz Library<br />
                    <input type="checkbox" name="EstherAtkinsonMuseum" value="1"  />Esther Atkinson Museum<br />
                    <input type="checkbox" name="EverettStadium" value="1" />Everett Stadium<br />
                    <input type="checkbox" name="GMGCScholarship" value="1" />Good Men Good Citizens Scholarship<br />
                    <input type="checkbox" name="KirkAthleticCenter" value="1" />Kirk Athletic Center<br />
                    <input type="checkbox" name="BaseballBigHittersClub" value="1"  />Baseball Big Hitters Club<br />
                    <input type="checkbox" name="BasketballRoundballClub" value="1" />Basketball Roundball Club<br /> 
                    <input type="checkbox" name="CrossCountryHarriers" value="1" />Cross Country Harriers<br />
                    <input type="checkbox" name="GolfHoleOneClub" value="1" />Golf Hole In One Club<br />
                    <input type="checkbox" name="FootballGridironClub" value="1" />Football Gridiron Club<br />
                    <input type="checkbox" name="LacrosseFaceOffClub" value="1" />Lacrosse Face Off Club<br />                                                                       
                    <input type="checkbox" name="SoccerGoalClub" value="1" />Soccer Goal Club<br />   
                    <input type="checkbox" name="TennisRacquetClub" value="1" />Tennis Racquet Club<br /> 
                    <input type="checkbox" name="SwimmingClub" value="1" />Swimming Club<br />
                    <input type="checkbox" name="RugbyClub" value="1" />Rugby Club<br />  
                    <input type="checkbox" name="UnrestrictedCapital" value="1" />Unrestricted Capital<br />   
                    <input type="checkbox" name="WilsonCenter" value="1" />Wilson Center<br />
                    <input type="checkbox" name="Other" value="1" />Other&mdash;<em>Explain in Special Instructions</em><br />                                
        </div>
            </div>
            <!--End Dropdown-->
            <br />

            <input type="checkbox" name="InMemoryOf" value="in_memory_of" class="enableInMemoryOf" />
        <label><strong>Is Your Donation In Memory of Someone?</strong></label>
            <!--Dropdown if selected-->
                <div id="ifInMemoryOfSelected">
                    <em>Who is your gift in memory of?</em></label> <br />
                    <input type="text" name="nameOfInMemory" size="85" value="" />
                </div>
                <!--End Dropdown-->
                <br />

                <input type="checkbox" name="InHonorOf" value="in_honor_of" class="enableInHonorOf" />
            <label><strong>Is Your Donation In Honor of Someone?</strong></label>
            <!--Dropdown if selected-->
                    <div id="ifInHonorOfSelected">
                    <em>Who is your gift in honor of?</em></label> <br />
                    <input type="text" name="nameOfInHonor" size="85" value="" />
                    </div>
                    <!--End Dropdown-->

New corrected markup:

<input type="checkbox" name="Class_Scholarships" value="class_scholarships" class="enableClassYearSelection" />
    <label><strong>Class Scholarships</strong></label>
    <!--Dropdown if selected-->
    <div id="ifClassScholashipsSelected">
        <label><em>Please select the appropriate class below</em></label>
        <br />
        <select name="SelectedClassYear">
        <option value="NoClass">Choose a Class</option>
        <option value="Class_Of_2003">Class of 2003 Scholarship IHO Ralph A. Crawley</option>
        <option value="Class_Of_2004">Class of 2004 Scholarship IMO C. Frazier 04 &amp; IHO W. Simms</option>
        <option value="Class_Of_2005">Class of 2005 Scholarship IMO Prof. Lee Cohen</option>
        <option value="Class_Of_2006">Class of 2006 Scholarship IMO Peter C. Bance Jr</option>
        <option value="Class_Of_2007">Class of 2007 Scholarship IHO Lt. Gen. Sam Wilson</option>
        <option value="Class_Of_2008">Class of 2008 Scholarship IHO Ms. Gerry Pettus</option>
        <option value="Class_Of_2009">Class of 2009 Scholarship</option>
        <option value="Class_Of_2010">Class of 2010 Scholarship IHO Mrs. Dottie Fahrner</option>
        <option value="Class_Of_2011">Class of 2011 Scholarship IHO Ms. Anita Garland</option>
        <option value="Class_Of_2012">Class of 2012 Scholarship IHO Mr. Jason M. Ferguson 96</option>
        <option value="Class_Of_1951">Class of 1951 Memorial Scholarship</option>
        <option value="Class_Of_1953">Class of 1953 Scholarship Endowment</option>
        <option value="Class_Of_1954">Class of 1954 Wilson Center Lecture Series</option>   
        <option value="Class_Of_1958">Class of 1958 Summer College Endowment Fund</option>  
        <option value="Class_Of_1960">Class of 1960 Good Men Good Citizens Scholarship</option>  
        <option value="Class_Of_1961">Class of 1961 Good Men Good Citizens Scholarship</option>
        <option value="Class_Of_1980">Class of 1980 Endowed Scholarship</option>
    </select>
    </div>
    <!--End Dropdown-->
    <br />

<input type="checkbox" name="CultureandCommunity" value="culture_and_community" />
<label><strong>Culture and Community</strong> &mdash; Supports the arts at Hampden-Sydney and service opportunities locally and around the world.</label><br />

<input type="checkbox" name="OtherFunds" value="other_funds" class="enableOtherFunds" />
    <label><strong>Would you like to donate to other funds?</strong></label>
    <!--Dropdown if selected-->
        <div id="ifOtherFundsSelected">
            <label><em>Please select the fund below</em></label> <br />
                <div class="scrolllist">
                <input type="checkbox" name="BortzLibrary" value="1" /> Bortz Library<br />
                <input type="checkbox" name="EstherAtkinsonMuseum" value="1"  />Esther Atkinson Museum<br />
                <input type="checkbox" name="EverettStadium" value="1" />Everett Stadium<br />
                <input type="checkbox" name="GMGCScholarship" value="1" />Good Men Good Citizens Scholarship<br />
                <input type="checkbox" name="KirkAthleticCenter" value="1" />Kirk Athletic Center<br />
                <input type="checkbox" name="BaseballBigHittersClub" value="1"  />Baseball Big Hitters Club<br />
                <input type="checkbox" name="BasketballRoundballClub" value="1" />Basketball Roundball Club<br /> 
                <input type="checkbox" name="CrossCountryHarriers" value="1" />Cross Country Harriers<br />
                <input type="checkbox" name="GolfHoleOneClub" value="1" />Golf Hole In One Club<br />
                <input type="checkbox" name="FootballGridironClub" value="1" />Football Gridiron Club<br />
                <input type="checkbox" name="LacrosseFaceOffClub" value="1" />Lacrosse Face Off Club<br />                                                                       
                <input type="checkbox" name="SoccerGoalClub" value="1" />Soccer Goal Club<br />   
                <input type="checkbox" name="TennisRacquetClub" value="1" />Tennis Racquet Club<br /> 
                <input type="checkbox" name="SwimmingClub" value="1" />Swimming Club<br />
                <input type="checkbox" name="RugbyClub" value="1" />Rugby Club<br />  
                <input type="checkbox" name="UnrestrictedCapital" value="1" />Unrestricted Capital<br />   
                <input type="checkbox" name="WilsonCenter" value="1" />Wilson Center<br />
                <input type="checkbox" name="Other" value="1" />Other&mdash;<em>Explain in Special Instructions</em><br />                                
        </div>
        </div>
        <!--End Dropdown-->
        <br />

                                <input type="checkbox" name="InMemoryOf" value="in_memory_of" class="enableInMemoryOf" />
                            <label><strong>Is Your Donation In Memory of Someone?</strong></label>
                            <!--Dropdown if selected-->
                                <div id="ifInMemoryOfSelected">
                                    <label><em>Who is your gift in memory of?</em></label> <br />
                                    <input type="text" name="nameOfInMemory" size="85" value="" />
                                </div>
                                <!--End Dropdown-->
                                <br />

                                <input type="checkbox" name="InHonorOf" value="in_honor_of" class="enableInHonorOf" />
                            <label><strong>Is Your Donation In Honor of Someone?</strong></label>
                            <!--Dropdown if selected-->
                                <div id="ifInHonorOfSelected">
                                    <label><em>Who is your gift in honor of?</em></label> <br />
                                    <input type="text" name="nameOfInHonor" size="85" value="" />
                                </div>
                                <!--End Dropdown-->
  • 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-10T16:39:09+00:00Added an answer on June 10, 2026 at 4:39 pm

    This is happening because your HTML is invalid.

    Near the beginning of your HTML, you open a <label> tag. Inside that <label> tag, you open a <div> tag. You then close the <label> tag before closing the <div> tag.

    This is a no-no. Move your </label> tag and it works:

    Change:      jsFiddle

        <label><strong>Class Scholarships</strong>
    <!--Dropdown if selected-->
    <div id="ifClassScholashipsSelected">
        <em>Please select the appropriate class below</em></label> <br />
    

    To:      jsFiddle

    <label><strong>Class Scholarships</strong></label>
    <!--Dropdown if selected-->
    <div id="ifClassScholashipsSelected">
        <em>Please select the appropriate class below</em><br />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on creating a form which pulls data from a database, and
I've been working on creating a form that submits content into my database but
I am working on creating a custom form designer in the Delphi IDE. I'm
I'm doing this tutorial: http://www.phpeveryday.com/articles/Zend-Framework-Database-Creating-Input-Form-P494.html We are building a simple input form using POST
I'm creating an html form that will allow a user to specify a variable-length
I'm working on creating an HTML form that has an image in the background.
I am creating a one-to-one relationship to user called user_info. Below is the working
I'm currently working on creating electronic version of various request forms. Each form will
I am creating a form which updates two related models, for this example a
I am creating an edit form for an Event data model in which the

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.