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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:51:12+00:00 2026-05-14T16:51:12+00:00

I need to trigger a click function assigned to a checkbox, but without actually

  • 0

I need to trigger a click function assigned to a checkbox, but without actually changing it’s checked state (which click() does).

Scenario: I have a form with several checkboxes that when selected reveal a textarea. This works fine, but I also need to call the click() function on $(document).ready()

My code is below, please note I have very limited access to changing the generated html. I have an object (admin_panels) which will store each checkbox and the texarea it should bring up.

var admin_panels = {"checkbox-id" : "textarea-id"};

$(document).ready(function(){
for (var elem in admin_panels) {
    $("#" + elem).click(admin_slide);
    // $("#" + elem).click();
}
})
function admin_slide() { 
    if ($(this).is(":checked")) {
        $("#" + admin_panels[this.id] + "-wrapper").slideDown();
  }else{
        $("#" + admin_panels[this.id] + "-wrapper").slideUp();
    }
}

Thanks

  • 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-14T16:51:13+00:00Added an answer on May 14, 2026 at 4:51 pm

    If you want to call the admin_slide function for an element, you can do this:

    admin_slide.call(domElement);
    

    The value of this within the admin_slide function will be set to domElement.

    In this case, domElement could be $('#'+elem)[0] or document.getElementById(elem).

    Edit:

    Another way to do this, using jQuery methods exclusively, is: $(selector).each(admin_slide). So your code could be:

    for (var elem in admin_panels) {
        $("#" + elem).click(admin_slide)
                     .each(admin_slide);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 524k
  • Answers 524k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I believe the $.extend() utility should work here: data: $.extend({… May 16, 2026 at 10:02 pm
  • Editorial Team
    Editorial Team added an answer Lekensteyn and Ken got it half right each. You have… May 16, 2026 at 10:02 pm
  • Editorial Team
    Editorial Team added an answer I have had similar problems with publishing websites using Visual… May 16, 2026 at 10:02 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I need to programmatically trigger a click event that's being handled by jQuery. Here's
How do I trigger this inline function onClick=showMenu('mnu_searches', event, 0, this) using JQuery...if I
I'm using a bit of jQuery to expand/hide some divs. I need to add
My code: <a href=# onclick=$('#s input[name='reset']').click(); return false;>RESET</a> Apparently as you can see I
You will notice when you click posture 1 the description drops down and images
I have got a group of radio buttons that when clicked need to display
The dropdowns on the top right, I need to get the first three characters
I'm programming a Webpage/-Application for the iPhone. I need to scroll to a specific
I'm using QTableView and QStandardItemModel now. In the QTableView, if you double-click a cell,
I am trying to use confirmation dialog from jQuery UI . I ran into

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.