Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Trigger qtip on validation failure
30th April, 10:59
Post: #1
[Solved] Trigger qtip on validation failure
Hi, I'm trying to combine qTip with the jQuery validationEngine - when a form submitted via ajax comes back as failed with errors, I want to generate a qTip popup. It's unusual to want to overlay the validation errors with a pop up, but on this occasion there is a good reason for it!

In this code, the failure function should trigger the qTip pop up, but the url for the content is never requested. I have tried replacing $(this) with the $('input#eligibility') selector, but this makes no difference. I have also tested that the failure callback gets called, the console.log('test') line works as expected.

Any help greatly appreciated!
JS Code
$('input#eligibility').live("click", function(){
			$(".form_container form").validationEngine({
				ajaxSubmit: true,
				ajaxSubmitFile: $(this).attr('action'),
				success :  function() {
					var url = $('input.next').attr('rel');
					ajaxFormStage(url);
				},
				failure : function() {
					//console.log('test');
					$(this).qtip(
      				{
        				content: {
            				// Set the text to an image HTML string with the correct src URL to the loading image you want to use
            				text: '<img src="/media/images/wait.gif" alt="Loading..." />',
            				url: '<?php echo url::base(); ?>help/ineligible'
         				},
         				hide: 'unfocus',
         				style: {
            				tip: true, // Apply a speech bubble tip to the tooltip at the designated tooltip corner
            				border: {
               					width: 10,
               					radius: 10
            				},
							width: {
								min: 200, 
								max: 400
							},
            				name: 'light', // Use the default light style
         				},
      				});
				}
			});
		});
Find all posts by this user
Quote this message in a reply
1st May, 19:40
Post: #2
RE: Trigger qtip on validation failure
franko, add into your code show.ready as true, since you're binding it on an event and want it to show immediately:

JS Code
$('input#eligibility').live("click", function(){
         $(".form_container form").validationEngine({
            ajaxSubmit: true,
            ajaxSubmitFile: $(this).attr('action'),
            success :  function() {
               var url = $('input.next').attr('rel');
               ajaxFormStage(url);
            },
            failure : function() {
               //console.log('test');
               $(this).qtip(
                  {
                    content: {
                        // Set the text to an image HTML string with the correct src URL to the loading image you want to use
                        text: '<img src="/media/images/wait.gif" alt="Loading..." />',
                        url: '<?php echo url::base(); ?>help/ineligible'
                     },
                     show: {
                        when: false,
                        ready: true
                     },
                     hide: 'unfocus',
                     style: {
                        tip: true, // Apply a speech bubble tip to the tooltip at the designated tooltip corner
                        border: {
                              width: 10,
                              radius: 10
                        },
                     width: {
                        min: 200, 
                        max: 400
                     },
                        name: 'light', // Use the default light style
                     },
                  });
            }
         });
      });

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
2nd May, 13:59
Post: #3
RE: Trigger qtip on validation failure
Thanks for the reply Craig. I tried your suggestion but this results in neither the validation errors or the qtip content being shown. If I comment out the qtip code, the validation errors appear as they should, but there seems to be some sort of conflict with the code i have at the moment. Any other ideas?
Find all posts by this user
Quote this message in a reply
4th May, 11:11
Post: #4
RE: Trigger qtip on validation failure
Got it sorted - problem was using $(this) from my callback - once I changed it to the element ID everything worked correctly. Thanks again Craig
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [Solved] Step-by-step tutorial trigger next from within popup? Joshy 2 522 13th December 13:32
Last Post: Joshy
  [Solved] qTip input fields validation not working with display:none Maverick 6 1,414 25th July 16:44
Last Post: Maverick
  post ajax from qtip2/validation form jquerynewb 4 1,346 14th July 08:19
Last Post: Craig
  [Solved] How to display php errors in a login validation usign qTip? mbarros 1 1,458 20th November 23:56
Last Post: mbarros
  qtip + jquery validation not showing the title of the input mbarros 3 1,809 16th November 23:13
Last Post: Craig
  Using qtip with jQuery validation framework mutleyoz 2 3,452 9th June 08:23
Last Post: lounge
  Qtip multi id trigger kazey 0 1,163 14th October 02:07
Last Post: kazey
  Validation XHTML abtip 6 1,323 11th October 00:30
Last Post: Craig
  jqmodal trigger on qtip hover in ie6 klb5770 3 2,286 18th August 14:27
Last Post: Craig
  Seperate Element To Trigger qTip Tap 2 770 9th June 13:51
Last Post: Craig



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