Error no such method show for tooltip widget instance

0 votes

I am using ajax to submit a form for my registration, but am having an issue trying to setup tooltips to display error messages for errors that come back from the controller.

JavaScript:

$(document).on('ajax:success', '.user_modal_form', function(e, data, status, xhr) {
  var context;
  context = $(this);
  if (data.success) {
    $('button', context).hide();
    $('.spinner', context).show();
    location.reload();
  } else {
    if (data.errors != null) {
      $.each(data.errors, function(key, error) {
        var field;
        field = $("#athlete_" + key);
        field.attr('data-original-title', "" + key + " " + error).tooltip({
          trigger: 'manual'
        }).tooltip("show");
      });
    }
  }
});

Error Message: Uncaught Error: no such method 'show' for tooltip widget instance

May 12, 2020 in JQuery by kartik
• 37,520 points
3,627 views

1 answer to this question.

0 votes

Hello,

The root of this and similar problem

"no such method 'hide' for tooltip widget instance"

that both JqueryUI and Boostrap have tooltip method,

JqueryUI works like:

$el.tooltip("option","show");
$el.tooltip("option","hide");

Boostrap works like:

$el.tooltip("show");
$el.tooltip("hide");

So, you need to reorder your scripts, for example with requirejs, you need to make Boostrap be loaded after JqueryUI

var $ = require('jquery');
require('jquery_ui');
require('bootstrap');

and adjust config for requirejs like:

    bootstrap: {
        deps: ['jquery', 'jquery_ui']
    },

Thank You!!

answered May 12, 2020 by Niroj
• 82,840 points

Related Questions In JQuery

0 votes
1 answer

Error: cannot call methods on dialog prior to initialization; attempted to call method 'close'

Hello, Try this - it works for me: $(".editDialog").on("click", ...READ MORE

answered May 12, 2020 in JQuery by Niroj
• 82,840 points
1,328 views
0 votes
1 answer

JQuery Error: cannot call methods on dialog prior to initialization; attempted to call method 'close'

Hello @kartik, Try this - it works for ...READ MORE

answered May 29, 2020 in JQuery by Niroj
• 82,840 points
1,995 views
0 votes
1 answer

Error:Laravel Method paginate does not exist

Hello @kartik, Try this: Dispatch::all() => Returns a Collection Dispatch::all()->where() => Returns a Collection Dispatch::where() => ...READ MORE

answered Dec 2, 2020 in JQuery by Niroj
• 82,840 points
7,824 views
0 votes
1 answer

jQuery fix for "Uncaught TypeError: $ is not a function" error

We can fix this error by using jQuery() . ...READ MORE

answered Jun 1, 2022 in JQuery by Edureka
• 13,690 points
5,809 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
22,970 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
2,973 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
2,902 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
44,423 views
0 votes
1 answer

Error: cannot call methods on dialog prior to initialization; attempted to call method 'close'

Hello @kartik, Looks like your buttons are not ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,840 points
8,886 views
0 votes
1 answer

Error: cannot call methods on button prior to initialization; attempted to call method 'loading'

Hii @kartik, It's caused by jquery-ui and bootstrap-button ...READ MORE

answered May 12, 2020 in JQuery by Niroj
• 82,840 points
6,512 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP