[jQuery] Re: (validate plugin) dependency callback not being triggered

2009-11-09 Thread Brad Hile
Thanks Jules I'll give it a try now.
I was looking for something that would trigger the validation but I
thought it was automagically triggered onblur/keyup but perhaps thats
only after the initially validate via submit

* thanks for the typo spotting!.. totally missed that

ta
Brad

On Nov 6, 11:14 am, Jules jwira...@gmail.com wrote:
 Hi,

 Validation only triggered if you call submit the page or call the $
 (form).valid() function. I didn't see any submit() or  $
 (form).valid() call in your page.

 Try adding this to your page

 js script inside ready()

 $(#validateMe).click(function(){
    if($(form).valid())
      alert(All data are valid);
    else
      alert(Invalid data);

 });

 html
 input type=button id=validateMe name=validateMe
 value=Validate /

 Hope this help.

 BTW: you misspelled territory in ACT :)

 On Nov 6, 12:06 pm, Brad Hile brad.h...@gmail.com wrote:

  Bump

   Hi
   I've tried every way I can think of to use dependency to enable
   additional elements to be required and have had no luck at all. I
   simply want to enable required on a number of fields when a specific
   radio button is selected and for it to be disabled when its not.
   (These fields are hidden when the radio button is deselected)
   I've tested the response from the functions and it appears correct but
   after hours of staring at this I just can't figure it out.
   Help.. please?

   original code is onhttp://promotionalpenshop.com.au/testorder.php?p=4
   though I may have changed it by the time you look at this.

   So basically I've tried an inline function  something like:

   organisation:{required: function(element) {
           return $(.payment_type:checked).val()  == 'invoice');
         }
      }
   - - - - - - - - - - - - - -
   Setting a var to true/false when the radio button is clicked and
   testing that:

   var invoice;

   $(.payment_type).change(function () {
        if($(this).val() != 'paypal'){
                    $(#paybyinvoicefields).slideDown('slow');
                   invoice =  true;
            } else {
    $(#paybyinvoicefields).slideUp('slow');
                   invoice =  false;
            }

   organisation:{required: invoice}
   - - - - - - - - - - - - - -
   Using an enternal function

   organisation:{required: invoiceme() }

           function invoiceme() {
              return ($(.payment_type:checked).val()  == 'invoice')?
   true : false;
       }


[jQuery] Re: (validate plugin) dependency callback not being triggered

2009-11-05 Thread Brad Hile
Bump

 Hi
 I've tried every way I can think of to use dependency to enable
 additional elements to be required and have had no luck at all. I
 simply want to enable required on a number of fields when a specific
 radio button is selected and for it to be disabled when its not.
 (These fields are hidden when the radio button is deselected)
 I've tested the response from the functions and it appears correct but
 after hours of staring at this I just can't figure it out.
 Help.. please?

 original code is onhttp://promotionalpenshop.com.au/testorder.php?p=4
 though I may have changed it by the time you look at this.

 So basically I've tried an inline function  something like:

 organisation:{required: function(element) {
         return $(.payment_type:checked).val()  == 'invoice');
       }
    }
 - - - - - - - - - - - - - -
 Setting a var to true/false when the radio button is clicked and
 testing that:

 var invoice;

 $(.payment_type).change(function () {
      if($(this).val() != 'paypal'){
                  $(#paybyinvoicefields).slideDown('slow');
                 invoice =  true;
          } else {
  $(#paybyinvoicefields).slideUp('slow');
                 invoice =  false;
          }

 organisation:{required: invoice}
 - - - - - - - - - - - - - -
 Using an enternal function

 organisation:{required: invoiceme() }

         function invoiceme() {
            return ($(.payment_type:checked).val()  == 'invoice')?
 true : false;
     }


[jQuery] Re: (validate plugin) dependency callback not being triggered

2009-11-05 Thread Jules
Hi,

Validation only triggered if you call submit the page or call the $
(form).valid() function. I didn't see any submit() or  $
(form).valid() call in your page.

Try adding this to your page

js script inside ready()

$(#validateMe).click(function(){
   if($(form).valid())
 alert(All data are valid);
   else
 alert(Invalid data);
});

html
input type=button id=validateMe name=validateMe
value=Validate /


Hope this help.

BTW: you misspelled territory in ACT :)

On Nov 6, 12:06 pm, Brad Hile brad.h...@gmail.com wrote:
 Bump

  Hi
  I've tried every way I can think of to use dependency to enable
  additional elements to be required and have had no luck at all. I
  simply want to enable required on a number of fields when a specific
  radio button is selected and for it to be disabled when its not.
  (These fields are hidden when the radio button is deselected)
  I've tested the response from the functions and it appears correct but
  after hours of staring at this I just can't figure it out.
  Help.. please?

  original code is onhttp://promotionalpenshop.com.au/testorder.php?p=4
  though I may have changed it by the time you look at this.

  So basically I've tried an inline function  something like:

  organisation:{required: function(element) {
          return $(.payment_type:checked).val()  == 'invoice');
        }
     }
  - - - - - - - - - - - - - -
  Setting a var to true/false when the radio button is clicked and
  testing that:

  var invoice;

  $(.payment_type).change(function () {
       if($(this).val() != 'paypal'){
                   $(#paybyinvoicefields).slideDown('slow');
                  invoice =  true;
           } else {
   $(#paybyinvoicefields).slideUp('slow');
                  invoice =  false;
           }

  organisation:{required: invoice}
  - - - - - - - - - - - - - -
  Using an enternal function

  organisation:{required: invoiceme() }

          function invoiceme() {
             return ($(.payment_type:checked).val()  == 'invoice')?
  true : false;
      }