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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:20:44+00:00 2026-05-31T02:20:44+00:00

So I want to change a hidden form field’s value from False to True

  • 0

So I want to change a hidden form field’s value from False to True when the user enters input data in another form field. This works fine with my select fields (dropdowns) in my form, but for my checkboxes and text input fields it isn’t working. This is my code

$(function(){
    $('#vmake').change(function(){
    $('#carsearch').val('True');
    });
});

So when they change the vmake field (a dropdown menu), the carsearch field changes its value to True. This works fine so I figured that if that worked, I could do the same thing with any text input, or checkbox, but it doesn’t seem to work. Is the .change event not appropriate to define a text input or a checkbox? Should I use a different event handler? This is an example of me trying to do the same thing with a checkbox field, but it doesn’t work.

$(function(){
    $('#year[]').change(function(){
    $('#carsearch').val('True');
});
  • 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-31T02:20:46+00:00Added an answer on May 31, 2026 at 2:20 am

    It looks like you’re using the wrong selector and event for the checking of a check box. Use the click event to see changes in the checked state of a check box

    $('#year').click(function() {
      var checked = $(this).is(':checked');
      var value = checked ? 'True' : 'False';
      $('#carsearch').val(value);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Jquery to change the value of a hidden input to 'True'
I am using Jquery to change the value of a hidden input to True
If you wanted to change the value of the hidden field to something not
i've a form in which user can inser a password in a input text
I'm using a formset with can_delete=True. I want to change the widget of the
Currently I have an HTML form with a hidden field right before a text
I have a web form to which I want to take a parameter from
<form onsubmit=submit(); return false; name=text id=form method=get> <input type=feild style=font-size: 150%; id=field name=field value=
I want to mask a date input to mm/dd/yyyy. When the form submits, i
I'm currently using the following to display an input field when I change 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.