spyr validation text with jquery serialize()

Posted by oz1453 on Stack Overflow See other posts from Stack Overflow or by oz1453
Published on 2010-04-28T13:10:18Z Indexed on 2010/04/28 13:13 UTC
Read the original article Hit count: 283

Filed under:

Code like this :

<form>
  <ol>
    <li>
      <fieldset>
        <legend>test</legend>
        <ol>
          <li>
            <label for="qwerty">qwerty</label>
            <span id="sprytextfield1">
            <input name="qwerty" type="text" id="qwerty" />
          <span class="textfieldRequiredMsg">error no qwerty input</span></span> </li>
        </ol>
      </fieldset>
    </li>
  </ol>
  <p style="text-align:right;">
    <input type="reset" value="reset" />
    <input type="submit" value="submit" />
  </p>
</form>

<script type="text/javascript">
$('form').submit(function() { 
  alert($(this).serialize());
  return false;
});
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["blur"]});
//-->
</script>

I want to do. when i click the submit button serialize the form but when no error with spyr. if the spyr validation text error appears don t serialize or alert.

i think.i must make a if condition before alert.

© Stack Overflow or respective owner

Related posts about serialize