Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
qtip + jquery validation not showing the title of the input
16th November, 18:33
Post: #1
qtip + jquery validation not showing the title of the input
Hi! Big Grin

I have one input: <input type="text" name="user" id="user" title="test" /> but whenever I positioned the mouse over this input, the default toolbox appeared. So, I removed it using:

JS Code
$('#user').each(function() {
    $this = $(this);
    $.data(this, 'title', $this.attr('title'));
    $this.removeAttr('title');
  });


The default toolbox no longer appears...

But How to add the title again only when the qTip toolbox appear?

Here is my complete code:
JS Code
$(document).ready(function(){
  $('#user').each(function() {
    $this = $(this);
    $.data(this, 'title', $this.attr('title'));
    $this.removeAttr('title');
  });
 
  var Login = $('#login');
 
  Login.validate({
    errorClass: "req",
    errorLabelContainer: $(".req"),
    onkeyup: false,
    rules: {
      user: { required: true },
    },
 
    errorPlacement: function(error, element)
    {
      $(element).filter('#user').qtip({
        overwrite: false,
        content: error,
        position: {
          corner: {
            target: 'topMiddle',
            tooltip: 'bottomMiddle'
          }
        },
 
        show: {
          event: false,
          ready: true,
          when: {
            event: 'focus',
            event:false
          }
        },
 
        hide: {
          when: {
            event: 'keypress'
          }
        },
 
        style: {
          background: '#7c1623',
          border: {
            color: '#7c1623',
            radius: 5,
            width: 5
          },
          color: '#fff',
          name: 'red',
          padding: 5,
          tip: true
        }
      });
    }
  });
});
Find all posts by this user
Quote this message in a reply
16th November, 19:53
Post: #2
RE: qtip + jquery validation not showing the title of the input
Well it looks like you're storing the title as data so:

JS Code
api: {
   onRender: function() {
      var target = this.elements.target;
      target.attr('title', target.data('title'));
   }
}

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
16th November, 22:21
Post: #3
RE: qtip + jquery validation not showing the title of the input
@Craig

Thanks for the help, but there remains a doubt:

- After saving the title, how to display it, replacing the default text "This field is required."?

Thanks

(16th November 19:53)Craig Wrote:  Well it looks like you're storing the title as data so:

JS Code
api: {
   onRender: function() {
      var target = this.elements.target;
      target.attr('title', target.data('title'));
   }
}
Find all posts by this user
Quote this message in a reply
16th November, 23:13
Post: #4
RE: qtip + jquery validation not showing the title of the input
Oh I see, try this:

JS Code
content: $(element).data('title')

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
  tip showing 2 times gkielwasser 8 240 5th May 19:00
Last Post: Craig
  [Solved] qtip showing content from db doesn't change when content in db changes. vtoepel 2 144 23rd April 16:02
Last Post: vtoepel
  the plugin do not work correctly with jquery 1.7? vic906 1 145 12th April 22:09
Last Post: Craig
  [Solved] Tipp with title & content in title fspade 2 360 21st February 06:42
Last Post: fspade
  Qtips with jquery UI Issue sherwoodbear79 2 432 15th February 15:36
Last Post: sherwoodbear79
  [Solved] Need some help:codes in Jquery BabyShung 1 338 29th January 16:35
Last Post: Craig
  Tooltips not loading jQuery or other js files from parent document crodesign 2 474 13th January 22:19
Last Post: crodesign
  qtip with jquery mobile tap event finedesignz 1 642 4th January 21:18
Last Post: Craig
  [Solved] Browser still showing regular tooltip in addition to qTip Ryan Williams 2 848 18th December 19:54
Last Post: Craig
  qtip inside the jquery UI Dialog tiggi 1 781 20th October 18:49
Last Post: Craig



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