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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:24:05+00:00 2026-05-28T03:24:05+00:00

Here is a form element I have. <select id=state name=state style=width: 212px;> <option value=nsw>New

  • 0

Here is a form element I have.

<select id="state" name="state" style="width: 212px;">
<option value="nsw">New South Wales</option>
<option value="qld">Queensland</option>
<option value="vic">Victoria</option>
<option value="nt">Northern Territory</option>
<option value="tas">Tasmania</option>
<option value="sa">South Australia</option>
<option value="wa">Western Australia</option>
<option value="act">Australian Capital Territory</option>
<option value="notinoz">Not in Australia</option>
 </select>

What I want to do is below this add another select box element , if user chooses “not in Australia” in the options above.
I am really after the cleanest lightest code possbile.

I am presuming we create a div and set visibility:hidden just not sure how to trigger it.

  • 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-28T03:24:06+00:00Added an answer on May 28, 2026 at 3:24 am
    <!doctype html>
    <head>
    
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
    
        <script>
            $(document).ready(function (){
                $("#state").change(function() {
                    // foo is the id of the other select box 
                    if ($(this).val() != "notinoz") {
                        $("#foo").show();
                    }else{
                        $("#foo").hide();
                    } 
                });
            });
        </script>
    
    </head>
    
    
    <body>
        <p>
            <select id="state" name="state" style="width: 212px;">
                <option value="nsw">New South Wales</option>
                <option value="qld">Queensland</option>
                <option value="vic">Victoria</option>
                <option value="nt">Northern Territory</option>
                <option value="tas">Tasmania</option>
                <option value="sa">South Australia</option>
                <option value="wa">Western Australia</option>
                <option value="act">Australian Capital Territory</option>
                <option value="notinoz">Not in Australia</option>
            </select>
        </p>
    
        <p id="foo" style="display:none;">
            <select style="width: 212px;>
                <option value="item1">Item</option>
                <option value="item2">Item</option>
                <option value="item3">Item</option>
            </select>
        </p>
    
    </body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a <select> form element where I create multiple <option> children based on
I have the following select form element, and I want to apply the rateit
I have a select element in the form with different options. On property of
I have a SELECT element in which I need to auto-select the appropriate option
I have a form in which i use javascript to set the select element
Here I have a password field: /*********************PASSWORD**********************/ $password = new Zend_Form_Element_Password('password'); $alnumValidator = new
I have this form right here, where the user will add the start date
I have this $data array: (built on a shell, not a form) (debugged here)
I have the following structure: <form> <div class=content> ... </div> <div class=action> <p>Select <a
<form method='post'> <input type='text' name='A'> <input type='text' name='B' readonly> <input type='text' name='C' class='CCC'> <select

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.