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

  • Home
  • SEARCH
  • 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 8019865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:31:10+00:00 2026-06-04T21:31:10+00:00

I have some jQuery functions which update some numbers when new values are selected

  • 0

I have some jQuery functions which update some numbers when new values are selected in a <SELECT> field. The <SELECT> items are added dynamically by the user, so these functions use the .live() function. Everything goes as planned in Mozilla, Chrome, and IE8, but when I try to access the page on my iPad the numbers are no longer being updated accordingly. I have to click the <SELECT> field a second time for the numbers to update. Here is one of my functions:

    // Update subtotal when .months is changed
    $(".months").live('click',function(){

        var pid = this.id.replace("months", "");
        var price = document.getElementById('row' + pid).className;
        updateSubtotal(pid, price);

    });

All of the functions are contained within the document.ready() block. I’ve tried ‘click change’ and just ‘change’ as well, but they have issues in some other browsers.

Thanks for any and all help!

  • 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-06-04T21:31:13+00:00Added an answer on June 4, 2026 at 9:31 pm

    iPad and select elements don’t play very nice. You will need to bind to blur if you need the selected value to do anything.

    Try something like this ( .months should be your select element ):

    // Update subtotal when .months is changed
    $(".months").on('blur', function(){
    
        var pid = this.id.replace("months", "");
        var price = document.getElementById('row' + pid).className;
        updateSubtotal(pid, price);
    
       });
    

    EDIT
    Try this:

    // Update subtotal when .months is changed
    $(document).on('blur|click', ".months", function(){
        var pid = this.id.replace("months", "");
        var price = document.getElementById('row' + pid).className;
        updateSubtotal(pid, price);
        });
    

    The nice thing about on() is that you can attach it to an element and delegate from there. Since your $(document) will always be there it can also catch elements you add dynamically to the page and which are not there from the beginning. Since your original code used live I
    expect the element to by loaded or generated dynamically. In that case in order to bind an event to it using on() you have to bind to the document and delegate to whatever .months is coming.

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

Sidebar

Related Questions

I've been writing some jQuery functions that have JavaScript variables and looping, etc inside
I have added some animation using jquery but it's not working: $('.test-container').click(function(){ $(this).css('background-color', 'rgb(119,
I have the following jQuery: // get position on new/removed items function get_new_position_for_all_items() {
I have some jQuery code that highlights which radio button is checked by turning
I have some divs with similar content and links, images etc request extended jQuery-functions.
I have some jQuery code: $(function(){ function someFunc(){ /*do something*/ }; ............. }); And
I have a via with some jQuery function to get value from HTML element
I have some jQuery code that intercepts links clicked on a page: $(document).ready(function() {
I have some code bound to the blur() event in jQuery: $('input[type=text]').blur(function () {
I have a little problem with some jquery and http://www.mikage.to/jquery/jquery_history_noc.html The function works great,

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.