2 Replies - 1255 Views - Last Post: 11 September 2012 - 06:19 AM

#1 danjapro  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 10-September 12

How to combine these two JQuery Function with else or else if statemen

Posted 10 September 2012 - 12:13 PM

I am trying to write these two function into simple else statement, where once validation is good and complete, page loading jquery begins.

Please guide, I tried a few things, none seem to work as need.


<script type="text/javascript">
	/* <![CDATA[ */
	jQuery(function () {
		jQuery("#oldpassword").validate({
			expression: "if (VAL.length > 5 && VAL) return true; else return false;",
			message: "Please enter a Current Password"
		});
		jQuery("#password").validate({
			expression: "if (VAL.length > 5 && VAL) return true; else return false;",
			message: "Please enter a valid New Password"
		});
		jQuery("#confirmpassword").validate({
			expression: "if ((VAL == jQuery('#password').val()) && VAL) return true; else return false;",
			message: "Confirm password doesn't match the new password"
		});
	}); /* ]]> */
	
</script>
<script type="text/javascript">
	/* <![CDATA[ */
	$(document).ready(function () {
		$("#loading-div-background").css({
			opacity: 0.8
		});
	});
	function ShowProgressAnimation() {
		$("#loading-div-background").show();
		$(".button-2").hide();
	} /* ]]> */
	
</script>






Is This A Good Question/Topic? 0
  • +

Replies To: How to combine these two JQuery Function with else or else if statemen

#2 danjapro  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 10-September 12

Re: How to combine these two JQuery Function with else or else if statemen

Posted 11 September 2012 - 06:09 AM

Need some feedback based on inquiry below, can any provide some uidance with this simple If ELSE issue, would be greatly appreciated.
Was This Post Helpful? 0
  • +
  • -

#3 danjapro  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 10-September 12

Re: How to combine these two JQuery Function with else or else if statemen

Posted 11 September 2012 - 06:19 AM

Tried combining my Jquery validate with proress animation like this, but does not work: these two functions need to work as validate is successful and all field filled, then do page animation of progress load.


          jQuery(function(){
		      if(validate){
                jQuery("#oldpassword").validate({
                    expression: "if (VAL.length > 5 && VAL) return true; else return false;",
                    message: "Please enter a Current Password"
                });
                jQuery("#password").validate({
                    expression: "if (VAL.length > 5 && VAL) return true; else return false;",
                    message: "Please enter a valid New Password"
                });
                jQuery("#confirmpassword").validate({
                    expression: "if ((VAL == jQuery('#password').val()) && VAL) return true; else return false;",
                    message: "Confirm password doesn't match the new password"
                });	
  		     
			 }else{
			   $(document).ready(function () {
					$("#loading-div-background").css({ opacity: 0.8 });
				   });

				  function ShowProgressAnimation() {
				   $("#loading-div-background").show();
				   $(".button-2").hide();
				  }
		      }
            });




Was This Post Helpful? 0
  • +
  • -

Page 1 of 1