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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:06:15+00:00 2026-05-31T21:06:15+00:00

I have this form: <input type=checkbox value=First />First <input type=checkbox value=Second />Second <input type=checkbox

  • 0

I have this form:

<input type="checkbox" value="First" />First
<input type="checkbox" value="Second" />Second
<input type="checkbox" value="Third" />Third

<select name="first-drop">
    <option value="---">---</option>
    <option value="Option1">Option1</option>
    <option value="Option2">Option2</option>
</select>

​Is there a way (using JS/jQuery) I can change the value of first-drop to --- whenever the First check box is unchecked?

  • 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-31T21:06:16+00:00Added an answer on May 31, 2026 at 9:06 pm
    $('input[type="checkbox"][value="First"]').change(function (){
        $('select[name="first-drop"]').toggle();
    });​
    

    LIVE DEMO

    Note that I fixed you markup:

    <input type="checkbox" value="First" checked="checked" >First
    <input type="checkbox" value="Second" />Second
    <input type="checkbox" value="Third" />Third
    
    <select name="first-drop">
        <option value="">---</option>
        <option value="Option1">Option1</option>
        <option value="Option2">Option2</option>
    </select>​
    

    Update:

    What you want now is:

    $('input[type="checkbox"][value="First"]').change(function() {
        if (!this.checked) {
            $('select[name="first-drop"] option:first').prop('selected', 'selected');
        }
    });
    

    ​LIVE DEMO

    If you will give your DOM elements ids it can be simple as that:

    $('#first').change(function() {
        if (!this.checked) 
            $('#nothing').prop('selected', 'selected');
    });
    

    Updated DOM:

    <input type="checkbox" value="First" id="first" >First
    <input type="checkbox" value="Second">Second
    <input type="checkbox" value="Third">Third
    
    <select name="first-drop">
        <option value="" id="nothing" >---</option>
        <option value="Option1" >Option1</option>
        <option value="Option2">Option2</option>
    </select>​
    

    LIVE DEMO

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

Sidebar

Related Questions

i have a form with checkboxes like this: <input type=checkbox name=type[] value=1 />Fast Food<br>
I have this input in a form: <input type=text value=<script src='/js/script.js' type='text/javascript'></script> name=embed/> The
I have this field in one form : <input type=text name=promocode id=promoCode value= style=width:24%
I have this HTML dropdown: <form> <input type=text id=realtxt onkeyup=searchSel()> <select id=select name=basic-combo size=1>
I have an html form with a checked checkbox: <input type=checkbox name=somebox value=somevalue checked
Consider this simple example code: <form name=text id=frm1 method=post> <input type=checkbox name=name[] value=1000> Chk1<br>
Roughly, this is my code: <form name=mpform id=mpform> <input type=checkbox onclick=mpfunc() id=mpay name=mpay[] value=19
I have this structure on form, <input type=test value= id=username /> <span class=input-value>John Smith</span>
I have a form where I've got three checkboxes like this: <td>Wireless <input type=checkbox
I have a form.html: <div id=tag_option> <li><label for=id_customer_type>Customer type:</label> <select id=id_customer_type class=required name=customer_type> <option

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.