Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble getting started with qTip
21st June, 14:08 (This post was last modified: 21st June 14:34 by eventide.)
Post: #1
Trouble getting started with qTip
I am using qTip to show a message for a dropdown (and eventually other elements when I get this working) when jQuery detects an item was not selected in the dropdown on form submission.

The qtip script file is uploaded and included in the head tag, as required.

Here's my jQuery code:
JS Code
if ($('select#docsList option:selected').val() == 0) {
	// No doc selected
	//$('#docsList').focus();
	$('#docsList').qtip({
		content: 'Please select a document.'
	});
	return false;
} else {
	selectedDocID = $('select option:selected').val();
}


The $('#docsList').focus(); is what I was using before and that does work, so I know my selector is correct.

Am I missing something to get the qtip tooltip to show?
UPDATE:

I just accidentally found out that the tooltip is showing, but only when the dropdown is moused-over. I need to have it appear right away when the error is detected and then I want to remove it when a selection is made.

How can I accomplish this?

Thanks for anyone's help!

f u cn rd ths u cn gt a gd jb n prgrmmng
Find all posts by this user
Quote this message in a reply
22nd June, 15:46
Post: #2
RE: Trouble getting started with qTip
Help?!

Anyone?!?!

f u cn rd ths u cn gt a gd jb n prgrmmng
Find all posts by this user
Quote this message in a reply
22nd June, 16:07
Post: #3
RE: Trouble getting started with qTip
Can you setup a test case at jsfiddle please? http://jsfiddle.net/MCRbs/

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
22nd June, 17:34
Post: #4
RE: Trouble getting started with qTip
(22nd June 16:07)Craig Wrote:  Can you setup a test case at jsfiddle please? http://jsfiddle.net/MCRbs/

I will do that this evening. Thanks for replying, Craig.

f u cn rd ths u cn gt a gd jb n prgrmmng
Find all posts by this user
Quote this message in a reply
22nd June, 22:14
Post: #5
RE: Trouble getting started with qTip
I'm not sure how to create a sample matching my situation. As you can see in the code in my OP, I am trying to get the tooltip to show as a result a of validation error, not as a result of the user clicking something, or a mouseover. I need to open and close the tooltip programmatically. As far as I know there's no event involved in this situation.

f u cn rd ths u cn gt a gd jb n prgrmmng
Find all posts by this user
Quote this message in a reply
23rd June, 02:21 (This post was last modified: 23rd June 02:25 by eventide.)
Post: #6
RE: Trouble getting started with qTip
Is there a function/method I can call to open/show and then close/hide the tooltip?

I saw in the "documentation" the show and hide options, but they both depend on an event.

f u cn rd ths u cn gt a gd jb n prgrmmng
Find all posts by this user
Quote this message in a reply
23rd June, 12:34
Post: #7
RE: Trouble getting started with qTip
You don't have to pass them events, just call them like so:
JS Code
$('.elementWithQTip').qtip('show');
$('.elementWithQTip').qtip('hide');

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
23rd June, 14:51
Post: #8
RE: Trouble getting started with qTip
(23rd June 12:34)Craig Wrote:  You don't have to pass them events, just call them like so:
JS Code
$('.elementWithQTip').qtip('show');
$('.elementWithQTip').qtip('hide');

In replying to your last post I almost recreated the full functionality related to my issue, so I thought at that point it'd be easiest if I take the time to create a Fiddle: http://jsfiddle.net/n2YbB/6/. That is code taken directly from my project (and stripped out for clarity and relevant functionality).

Couple of things regarding how it is behaving:
1) as you'll see, the tooltip only shows when the dropdown is moused-over
2) using "show" and "hide" as you suggested had no effect
3) I originally had the qtip definition inside the validation function and experienced the same behavior

Hopefully, with that Fiddle we'll be able to get this ironed out quickly!

Thanks!

f u cn rd ths u cn gt a gd jb n prgrmmng
Find all posts by this user
Quote this message in a reply
23rd June, 18:40
Post: #9
RE: Trouble getting started with qTip
See here: http://jsfiddle.net/n2YbB/7/

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
23rd June, 18:54
Post: #10
RE: Trouble getting started with qTip
(23rd June 18:40)Craig Wrote:  See here: http://jsfiddle.net/n2YbB/7/

Thanks, but as I only want to display the tooltip as the result of failed validation, I don't want it to show up until it is called in the validation function - not show up on load. Not knowing exactly what it will do, I thought I'd try changing prerender to false, but that had no effect that I could see.

How do I prevent it from showing on load and then make it show when the validation fails? (And subsequently hide it again when validation passes.)

f u cn rd ths u cn gt a gd jb n prgrmmng
Find all posts by this user
Quote this message in a reply
26th June, 12:29
Post: #11
RE: Trouble getting started with qTip
Remove the AddClassesToDoc call at the bottom Smile http://jsfiddle.net/n2YbB/11/

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
  Trouble getting results bmzarzaur 3 67 13th May 12:52
Last Post: Craig
  [solved] Trouble with qtips adding a scrollbar momentarily to window patricia 0 352 2nd December 19:40
Last Post: patricia
  [Solved] Having trouble updating qtip position using API breadtruck 4 2,923 21st March 18:46
Last Post: breadtruck
  [Solved] Refreshing content trouble limitlis 1 415 19th January 13:01
Last Post: Craig
  Trouble with explorer micke.schollin 1 399 23rd November 16:19
Last Post: Craig
  trouble loading dynamic content roryreiff 1 732 8th October 23:43
Last Post: Craig
  trouble with 'this' marko 2 591 8th September 05:00
Last Post: patrickberkeley
  trouble with font styles luke 1 604 4th August 04:09
Last Post: tups
  Getting Started dustin 2 899 20th March 17:47
Last Post: dustin



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