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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:40:19+00:00 2026-05-15T10:40:19+00:00

I am loading a jQuery qtip on hover (as it usually works). Inside this

  • 0

I am loading a jQuery qtip on hover (as it usually works). Inside this qtip, there is a textbox and a button. On the click of this button, I want to do something with the value of this textbox. Somehow, jQuery’s .val() function returns me the initial value of the textbox. Where am I going wrong?

jQuery code:

$(function() {
    $("#someplace").qtip({
        content: $("#popup"),
        hide: {
            fixed: true
        },
        position: {
            corner: {
                tooltip: 'topMiddle',
                target: 'bottomMiddle'
            },
            adjust: { 
                x:-30,
                y:-75
            }
        },
        style: {
        width:'100px',
            color:'white',
            name:'tspopup'
        }
    });

    $("#button_in_the_qtip").click(
        function () {
            var txt = $("#textbox_in_the_qtip").val();
            alert($("#textbox_in_the_qtip").attr('id')); // This returns "textbox_in_the_qtip"
            alert(txt); // This returns "abc" <---- Problem
        }
    );
});

HTML code for the popup qtip:

    <div style="display:none;" id="popup">
        <table cellpadding="5px" border="1" style="margin-top:12px; margin-bottom:12px; color:#fff; font-size:.7em;">
            <tr>
                <td>
                    <input type="text" id="textbox_in_the_qtip" value="abc" />
                </td>
                <td>
                    <button id="button_in_the_qtip">Add</button>
                </td>
            </tr>
        </table>
    </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-15T10:40:19+00:00Added an answer on May 15, 2026 at 10:40 am

    I tried out your code and I think the problem might be the version of jQuery you are using. According to the qTip site you should be using jQuery 1.3.2. Your code works when you use the older version.

    UPDATE:

    The problem is that the call $("#button_in_the_qtip").click(...) is only affecting the button inside of the #popup div. The way qTip works is it actually creates a clone of the content div, and generates the html for the tooltip only when you hover over the target element. basically you need to add the click listener after the qTip is created.

    To fix this move your button function inside of the qtip api callback onContentUpdate

    api: {
            onContentUpdate: function(){
                $("#button_in_the_qtip").click(function () {
                    var txt = $("#textbox_in_the_qtip").val();
                    alert($("#textbox_in_the_qtip").attr('id')); // This returns "textbox_in_the_qtip"
                    alert(txt); // This returns "abc" <---- Problem
                });
            }
    

    The only last step is to remove the #popup from the page, which you can do right in the qtip options

    content: $("#popup").remove(),
    

    This is necessary because otherwise there would be duplicate elements on the page with the same ID, and jQuery doesn’t like that.

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

Sidebar

Related Questions

I'm loading a jquery dialog with paramater on button click. (able to do) This
I got this jQuery pre-loading script running on a index.html page loading about 10Mb
After loading a PHP template (using jQuery's load function), this simple script won't make
I am using the jQuery qTip plugin and am having trouble loading html content
qTip...a jQuery custom tooltip plugin... isn't loading dynamic content for IE8 (haven't tested in
I'm loading JQuery into my TYPO3 page by : page.headerData.10.value = <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js></script>
I'm loading up jquery and modernizr in the head of my document like this:
I am loading jQuery like this require({ baseUrl: '{{ STATIC_URL }}js', paths: { jQuery:
I am having issues with loading jQuery with Javascript. I need to load it
I am loading a jQuery UI window a few scrolls down from the top

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.