kswedberg/jquery-cluetip — Issue #81: Cleetip not updating form elements contained within the clue tip itself
Author: steveswinsburg
Created: 2012-02-28 05:04:16+00:00
State: open

I have a cluetip div that contains a checkbox and a text area. When a user hovers over an item, it appears. When they click the tcheckbox, it fires an ajax request to retrieve a value from the server. It is then meant to update the value in the text area. But it is not.

The code works perfectly without the slue tip (i.e. if I don't bind it, and just have the elements on screen), it is only when the elements are within the slue tip that it does not update.

HTML:

click this

Short URL
http://someurl.com

Javascript (two pieces):

//bind directurl checkboxes
jQuery('a.tool-directurl').cluetip({
local:true,
arrows: true,
cluetipClass: 'jtip',
sticky: true,
cursor: 'pointer',
activation: 'click',
closePosition: 'title',
closeText: ''
});

function toggleShortUrlOutput(defaultUrl, checkbox, textbox) {

if($(checkbox).is(':checked')) {

$.ajax({
url:'/direct/url/shorten?path='+encodeURI(defaultUrl),
success: function(shortUrl) {
$('#'+textbox).val(shortUrl);
}
});
} else {
$('#'+textbox).val(defaultUrl);
}
}

Is there a way to update an element contained within the clue tip itself?