views:

176

answers:

2

Hi Chaps, I have a PHP form with one input and a button. A jQuery script ('loading' animated gif) is triggered on the click of the submit button. I also have a Spry Validation field linked to the input. At the moment, if the validation is triggered, the animated gif continues and won't stop. The furthest I've managed to get with it, is to click the validation message to stop the animation, but what I'm really after is to stop the animation when the validation is visible/triggered, but I can't find a suitable Event.

  $(function() {
    $("#button_download")
     .click(function() {
     })
     .throbber();

    $("#sprytextfield1")
     .click(function(sprytextfield1) {
      $.throbberHide();
     })
  });

If someone can point me in the right direction, that would be sweet.

A: 

You can bind to a different Event, for example

$("#srpytextfield").bind("click:validation", function() {
});

and now you can trigger this with

$("#srpytextfield").trigger("click:validation");

You can put this code where it is necesasry

Boris Barroso
Hi, thanks for the reply, I'm not sure if this is one bit code, split into two, or two bits of code which will do the same job. I'm not sure if I explained my problem correctly or not, but I want the 'throbber' to disappear once the sprytextfield validation appears/is triggered. Cheers
samuel baldus
A: 
$(document).ready(function()
{


    $('form').submit(function() 
    {

deger=document.getElementById("mustbe").value; //spry checks input textfield id="mustbe"

    if (deger!='') 
{  

  $("#result").load("doit.php", $('form').serialize());
  return false;

}
else 
{
  return false; 
}

});

});

i ask this question before but i take no answer and do it myself like this. And this is not a good answer,i am still searching ! (there must be a function to check spry validation in sprytextvalidation.js)

oz1453