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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:28:10+00:00 2026-05-23T11:28:10+00:00

I am implementing a Billing address is same as Address type function, which when

  • 0

I am implementing a “Billing address is same as Address” type function, which when a checkbox is checked fills the fields based on the other fields. Works perfectly.

The function for the click event..

    if ($(this).attr('checked')) {
        // copy address fields to billing fields
    }
    else{
        // clear fields
    }

Now I use an event (jquery hotkey plugin) to auto fill all of the fields in the form so I can easily and quickly demo and test the form. Instead of cheating and filling in the billing fields as the address fields i want to use

$("#CheckboxForAutofillId").trigger('click'); 

This does not work the first time I fire the event, as in the above function which is called it checks for the attribute of checked, however the trigger(‘click’), apparently calls the event BEFORE it changes the attribute.

Which means for me to simulate it correctly I have to do this..

$("#CheckboxForAutofillId").attr("checked", "checked"); // sets checked
$("#CheckboxForAutofillId").trigger('click');           // fires event then 'unchecks'
$("#CheckboxForAutofillId").attr("checked", "checked"); // rechecks

Reading the jquery page for trigger, I didn’t notice this mentioned, and I haven’t bothered to dig through the source to see what actually is occurring but it seems to me that ideally the trigger event should set the ‘checked’ attribute before firing the event itself as that is a better simulation of a person checking a checkbox?

Am I missing something?

  • 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-23T11:28:10+00:00Added an answer on May 23, 2026 at 11:28 am

    you should use change() instead of click().

    $("#CheckboxForAutofillId").change(function()
    {
        if(this.checked) ...
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm implementing in-app billing support in my application. I just realized that even though
While implementing the in-app billing for Android application, I came across a problem. Let
I've been working on implementing in-app billing, basing it off of blundell's tutorial here:
While implementing a flash-based uploader , we were faced with an issue: Flash doesn't
I am implementing a billing system for a client. I wrote this XML query
I was having problems earlier implementing in-app billing for android. I have fixed that
I've been working on implementing an in-app billing in Android for the app I'm
Implementing a datastructure with two function pointers, key_eq and key_hash . When these function
When implementing a factory or simple factory, what would go against using a Type
Im implementing a reminder app.There are two reminders (one for everyday and other for

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.