views:

163

answers:

1
<input id="name" name="user[name]" size="30" title="Please enter a valid name." type="text" />
<input id="email" name="user[email]" size="30" type="text" />

$(document).ready(function(){
  $(':text').tooltip({
    events: {
      input: 'mouseover, mouseout'
    },
    opacity: 0.95,
    position: 'top center',
    effect: 'slide',
    tip: 'test.field-tip',
    onBeforeShow: function(args){
      if(this.getTrigger().data('title') == undefined)
        return true;
      return false;
    }
  });
});

The tooltip should only appear the on name since it is the only field with a given title. That's how I'm trying to approach it, but it doesn't seem to work. Any ideas?

+2  A: 

Change your selector to

$(":text[title]")
nickf
That worked. Thanks!
Erol