[jQuery] Re: Validation on a Modal form does not work

2010-01-18 Thread IntelliCAD
We have a similar problem. When trying to validate the modal dialog
box decides its tired and goes away. Not sure how to do validation on
the form without it disappearing...

On Jan 7, 10:39 am, Elan Noy elan...@gmail.com wrote:
 I have amodalform that I want to validate.
 Themodalis based on the simplemodalplugin and thevalidationis
 based onvalidationplugin.
 Thevalidationworks well on a regular (nonmodal) form. ANy ideas?

  script type=text/javascript
             jQuery.validator.addMethod(zip, function(value, element)
 {
                 return this.optional(element) || value.match(/^((\d{5}-
 \d{4})|(\d{5})|([a-z]\d[a-z]\s?\d[a-z]\d))$/i);
             }, US or Canadian postal code only);
             $(document).ready(function(){
                 getaddressBook();
                 $(#addAddress).validate({
                     rules: {
                         emzip: {
                             required: true,
                             zip: true,
                         },
                     },
                 });
             });
         /script


Re: [jQuery] Re: Validation on a Modal form does not work

2010-01-18 Thread Nathan Klatt
 On Jan 7, 10:39 am, Elan Noy elan...@gmail.com wrote:
 I have amodalform that I want to validate.
 Themodalis based on the simplemodalplugin and thevalidationis
 based onvalidationplugin.
 Thevalidationworks well on a regular (nonmodal) form. ANy ideas?

  script type=text/javascript
             jQuery.validator.addMethod(zip, function(value, element)
 {
                 return this.optional(element) || value.match(/^((\d{5}-
 \d{4})|(\d{5})|([a-z]\d[a-z]\s?\d[a-z]\d))$/i);
             }, US or Canadian postal code only);
             $(document).ready(function(){
                 getaddressBook();
                 $(#addAddress).validate({

Could it be simply that the document is already ready so your ready
function is not being called? Try executing the contents of the ready
function inline?

Nathan