We help IT Professionals succeed at work.

jquery validation plugin just not working..

Hello for some odd reason this , which use to work .. now doesn't.. anyone know what is off here?  The validation script is below.. and the form is located here... http://www.aachamber.org/membership/membership-application.html

Thank you for the help.. Cheers -Jeremy
$(function(){
var val='';
///
	if($("form[name$='Reg']").length>0){
		//alert('found it');
		var validator = $("form[name$='Reg']").validate({
			onkeyup: true
			//,debug:true
		});
	}



	if($("#descriptionofcompany").length>0){ 
		$("#descriptionofcompany").rules("add", {
				required: true,
				onkeyup: true,
				maxlength: 4,
				messages: {
					required: "Please enter a valid email address",
					maxlength: "You have gone passed the 200 word limit."
				}
			});	
	}
	if($("#email").length>0){ 
		$("#email").rules("add", {
				required: true,
				onkeyup: false,
				email:true,
				messages: {
					required: "Please enter a valid email address",
					email: "Please enter a valid E-Mail <em>Try XXXXX@XXXX.XXX</em>"
				}
			});	
		$("#email").change(function() {
			val='';
			var U=$(this).val();
			$(this).closest('.info').append('<img src="http://test.aachamber.org/uploads/images/ajax-loader.gif" id="userL"/>');
			$.get("http://test.aachamber.org/index.php?page=membership-application", { 
					  showtemplate: "false",
					  Email: U
				  },
				  function(data) {
					val=data;
					if($("#userL").length!=0){$("#userL").remove();}
			
						$("#email").rules("add", {
							required: true,
							onkeyup: false,
							remote: "http://test.aachamber.org/index.php?page=membership-application?showtemplate=false&TestEmail=true&Email="+U,
							email:true,
							messages: {
								required: "Please enter a valid email address",
								remote: "Please enter a valid email address",
								email: "Please enter a valid E-Mail <em>Try XXXXX@XXXX.XXX</em>"
							}
						});
					});
			return false;
		});
	}

	if($(".email").length>0){ 
		$(".email").rules("add", {
				required: true,
				onkeyup: false,
				email:true,
				messages: {
					required: "Please enter a valid email address",
					email: "Please enter a valid E-Mail <em>Try XXXXX@XXXX.XXX</em>"
				}
			});	
	
		$(".email").change(function() {
			val='';
			var U=$(this).val();
			$(this).closest('.info').append('<img src="http://test.aachamber.org/uploads/images/ajax-loader.gif" id="userL"/>');
			$.get("http://test.aachamber.org/index.php?page=membership-application", { 
					  showtemplate: "false",
					  Email: U
				  },
				  function(data) {
					val=data;
					if($("#userL").length!=0){$("#userL").remove();}
			
					$(".email").rules("add", {
						required: true,
						onkeyup: false,
						remote: "http://test.aachamber.org/index.php?page=membership-application?showtemplate=false&TestEmail=true&Email="+U,
						email:true,
						messages: {
							required: "Please enter a valid email address",
							remote: "Please enter a valid email address",
							email: "Please enter a valid E-Mail <em>Try XXXXX@XXXX.XXX</em>"
						}
					});
				});
			return false;
		});
	}

});

Open in new window

Comment
Watch Question

Commented:
The problem is with the path to your jquery.validate.min.js file.

<script src="•http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js" type="text/javascript"></script>

Should be:

<script src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js" type="text/javascript"></script>

You have • in the first path.

Commented:
Also I don't see anywhere that the validation script you included above is on your page.

Author

Commented:
oddly that was, thou an issue I added today :) .. that is not the issue.. but is why I was not spoting the error again.. lol.. so..

      if($("form[name$='Reg']").length>0){
            //alert('found it');
            var validator = $("form[name$='Reg']").validate({
                  onkeyup: true
            });
      }

keeps giving me..

" $("form[name$='Reg']").validate is not a function
[Break on this error] onkeyup: true  "


thanks for the help.. Cheers -Jeremy

Author

Commented:
ok.. it was the CDN.. pull it local no prob...

Author

Commented:
tk for the help