Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
qtip on a disabled checkbox
15th December, 15:10
Post: #1
qtip on a disabled checkbox
Hi,

Is it possible to get qtip show for disabled checkboxes?

I have a checkbox setup like:

JS Code
<div style="white-space: nowrap;">
      <input id="checkbox_1" type="checkbox" name="something" disabled="disabled" />
      <span id="checkbox_1_text">some text</span>
</div>
<div style="white-space: nowrap;">
      <input id="checkbox_2" type="checkbox" name="something_else" />
      <span id="checkbox_2_text">some other text</span>
</div>


Then I try to make qtip appear for both, the text and for the checkboxes:

JS Code
<script type="text/javascript">
$('#checkbox_1').qtip({content: 'some content', position: { adjust: { x: 4, y: 3 } } });
$('#checkbox_1_text').qtip({content: 'some content', position: { corner: { target: 'bottomLeft' } } });
$('#checkbox_2').qtip({content: 'some other content', position: { adjust: { x: 4, y: 3 } } });
$('#checkbox_2_text').qtip({content: 'some other content', position: { corner: { target: 'bottomLeft' } } });
</script>


But the qtips doesn't show up for the checkboxes that are disabled. Any way to do that?
Find all posts by this user
Quote this message in a reply
15th December, 22:57
Post: #2
qtip on a disabled checkbox
Hello doze,

Have you tried including the checkbox within your span element? I haven't tested it, but that way you should only need to instantiate a qtip for the span element and it should show whether you are over the checkbox or the text.
You may need to set the span display to block.

Anyway, if that doesn't work, I will test your code and see what I can find.

Thanks!

Dustin
Find all posts by this user
Quote this message in a reply
16th December, 13:27
Post: #3
qtip on a disabled checkbox
Hi Dustin,

I tried to wrap the checkbox in to the span also, and tried to set the span to block level element, but it didn't work..

It only shows the qtip from the text and not when hovering the checkbox.
Find all posts by this user
Quote this message in a reply
16th December, 15:37
Post: #4
qtip on a disabled checkbox
doze,

On doing some further reading, disabled elements purposely ignore events. So in all the cases I tried, in a div, span, link etc. The disabled control always ignored my events. Even when I just used basic javascript event handlers.

A possible work around to this would be to hide the disabled checkbox and show an image in it's place(of a disabled checkbox) This would show the tooltip properly when users mouseover the image. Then, when you re-enable the checkbox, you simply hide the image and show the checkbox.

Anyway, Craig's javascript-fu is better than mine, he may know of something that I don't. Big Grin
Find all posts by this user
Quote this message in a reply
17th December, 01:25
Post: #5
qtip on a disabled checkbox
doze,

As dustmoo pointed out disabled elements don't register events, since in essence that defines what a disabled input actually is. However, the best way to get around this is to simply define a seperate show target, such as the inputs parent element.

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [Solved] How to make qTip work with AJAX and a "enable/disable" checkbox? xzuttz 4 1,051 24th August 19:04
Last Post: Craig
  [Solved] qTip when element disabled? briandaly40 3 1,706 6th December 03:29
Last Post: Craig
  synchronize checkbox states wasser 0 324 20th June 07:51
Last Post: wasser
  how to disable qtip when associated control is disabled. r_beacroft 3 1,291 11th January 13:06
Last Post: Craig
  Disabled Border and IE7 marclemagne 2 935 29th December 22:38
Last Post: marclemagne
  How to keep qtip disabled after initialization? hakka 1 952 3rd June 02:17
Last Post: Craig
  Using a href if javascript disabled Tajutondarra 2 2,001 4th May 13:18
Last Post: Tajutondarra
  Using qTip on checkbox rayray1940 4 1,564 20th March 03:13
Last Post: rayray1940



User(s) browsing this thread: 1 Guest(s)