开发者

jQuery / Spry Validation / Problem

开发者 https://www.devze.com 2022-12-23 00:18 出处:网络
I have a PHP form with one input and a button. A jQuery script (\'loading\' animate开发者_如何学Cd gif) is triggered on the click of the submit button.

I have a PHP form with one input and a button. A jQuery script ('loading' animate开发者_如何学Cd 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.


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


$(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)

0

精彩评论

暂无评论...
验证码 换一张
取 消