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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:32:35+00:00 2026-05-15T15:32:35+00:00

i have the following jquery code: $(document).ready(function() { $(‘.restrictiveOptions input[type!=checkbox], .restrictiveOptions select’).change(function() { //

  • 0

i have the following jquery code:

$(document).ready(function() {
            $('.restrictiveOptions input[type!=checkbox], .restrictiveOptions select').change(function() {
                // check off enabled for that row if anything changed
                $(this).closest('.fieldRow').find('.restrictiveOptionEnabled').attr('checked','true');
                alert('changed');
            });
        });

however, when i change the inputs or selects, nothing happens (not even the alert)!

i have checked that $('.restrictiveOptions input[type!=checkbox], .restrictiveOptions select') is correct (by using firebug console and checking the .length, which returned 484).
i have also made sure there are no syntax errors.

what do you think i’m doing wrong? thanks!

EDIT: i’ve updated the code and changed $(self) to $(this), but am still not seeing an alert. here is sample html (sorry for the formatting, i added line breaks but it is generated by php):

<fieldset class="restrictiveOptions"><legend class="collapsable">
<img width="12" height="12" title="Collapse" alt="Collapse" class="toggle" src="branding/default/images/collapse.gif"> Restrictive Options</legend>
<div style="">
<div class="fieldRow">
<div class="label">
<label>Executive</label></div>
<div class="fieldWrapper">
<div class="cellValue">
<select onchange="changeRestrictionValue(&quot;event42_41&quot;)" id="event42_41_restrictionType" name="event42_41_restrictionType">
<option selected="selected" value="1">is equal to</option>
<option value="2">is not equal to</option></select> 
<span id="event42_41_restrictionValue1Wrapper" class="event42_41_restrictionValueWrapper">
<select onchange="validateField(this)" name="event42_41_restrictionValue" id="event42_41_restrictionValue">
<option value="76">Yes</option>
<option value="77">No</option></select></span>
<span style="display: none;" id="event42_41_restrictionValue2Wrapper" class="event42_41_restrictionValueWrapper">
<select onchange="validateField(this)" name="event42_41_restrictionValue1" id="event42_41_restrictionValue1">
<option value="76">Yes</option>
<option value="77">No</option></select> and 
<select onchange="validateField(this)" name="event42_41_restrictionValue2" id="event42_41_restrictionValue2">
<option value="76">Yes</option>
<option value="77">No</option></select></span></div>
<div style="float: right;" class="cellValue">
<label for="event42_41_enabled">Enabled?</label>
<input type="checkbox" style="vertical-align: sub; margin: 2px; padding: 0pt;" class="restrictiveOptionEnabled" title="Check me to enable this restrictive option" name="event42_41_enabled" id="event42_41_enabled" value="">
</div></div></div>
  • 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-15T15:32:35+00:00Added an answer on May 15, 2026 at 3:32 pm

    This shouldn’t make any difference unless there’s something going on that you haven’t mentioned. Instead of directly binding the handler to all those elements, try setting up a “live” handler:

    $(function() {
      $('.restrictiveOptions input[type!=checkbox], .restrictiveOptions select')
        .live('click', function(ev) {
          $(this).closest('.fieldRow').find('.restrictiveOptionEnabled').attr('checked','true');
          alert('changed');
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following jQuery code that works: $(document).ready(function () { $(input[id^='pos_']).change(UpdatePosition) }); function
I have the following JQuery code: <script type=text/javascript> $(document).ready(function () { var $containerHeight =
I have the following jquery-code: <script type=text/javascript> $(document).ready(function() { $ ('ul.image-list li:even').addClass ('even'); $
I have the following jquery code in my view <script type=text/javascript> $(document).ready(function () {
I have the following jquery code: $(document).ready(function() { $(body[class*=page-calendar-practices] #content-header h1#title).after(<div id='athletics_practice-schedule'><div id='inner-title'><a href='www.example.com'
I have the following JQuery code: $(document).ready(function () { var $containerHeight = $(window).height(); if
I have the following code: $(document).ready(function() { // Manage sidebar category display jQuery(#categories >
I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
I have the following code: $(document).ready(function () { $(tr).live('click',function(){ alert(TR); }); $(input).live('click',function(){ alert(INPUT); });
I have the following jquery code: $(document).ready(function() { $(#build_table, a.coursename, .Start Date, .Book Title,

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.