score:1

ok, I think I've got it. I need to give each form a unique class (or ID) rather than giving them all the same class of validate, and reference the new class in the javascript.

score:2

You are right; I had similar experience using software worklight, maybe because of its ajax control and iframe integration.

I suggest creating a globalValidation.js with following code

$(document).on('pageinit pageshow', 'div:jqmData(role="page"), div:jqmData(role="dialog")', function(){
    if($("form.validate").length > 0){
      $("form.validate").validate({
        rules: {
          firstname: {
            required: true,
            minlength: 2
          },
          lastname: {
            required: true,
            minlength: 2
          },
          email_address: {
            required: true,
            email: true
          },
          password: "required"
        }
      });
    }
  });

and then , include it in your header as <script src="globalValidation.js " /> before </head>.


Related Query

More Query from same tag