You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

A better initialization for the tooltip FORM demo Created Oct 15, 2009

This thread is solved

Views: 1410     Replies: 1     Last reply Nov 23, 2009  
You must login first before you can use this feature

degenerate

Posts: 156

Registered:
Sep 19, 2008

A better initialization for the tooltip FORM demo

Posted: Oct 15, 2009

Look Here:
http://flowplayer.org/tools/demos/tooltip/form.htm

This is the tooltip "form" demo. Notice how in the initialization code, you see:
$("#myform :input").tooltip({

With this particular example, EVERY SINGLE input element is given a "title" attribute for the tooltip, such as:
title="Must be at least 8 characters."
Here is the problem with this initialization: If you do not specify a title attribute, a tooltip from a nearby element will still appear! So the following code will still generate an (unwanted) tooltip:
<input id="email" />

The solution (if you don't want to specify a tooltip for every element) is to initialize the tooltip differently.

Instead of using :input to target each input element in the form, use [title] to target each element with a "title" attribute:

$("#myform [title]").tooltip({

Hopefully this will be changed on the demo page to greatly reduce confusion for new users and make tooltips less troublesome.

degenerate

Posts: 156

Registered:
Sep 19, 2008

» A better initialization for the tooltip FORM demo

Posted: Nov 23, 2009

Reply to: A better initialization for the tooltip FORM demo, from degenerate
Bumping this. I still think it's a good idea.