$(document).ready(function() {
	$('#butsaveCP').on('click', function() {
		$("#butsaveCP").attr("disabled", "disabled");
		var userid = $('#user_drop').val();
		var password1 = $('#password1').val();
		var password2 = $('#password2').val();

		if(userid!="" && password1!="" && password2!=""){

			if(password1!=password2) {
			alert("Passwords do not match..");
			}
			else {

			$.ajax({
				url: "changeUserPassword.php",
				type: "POST",
				data: {
					userid: userid,
					password: password1	
				},
				cache: false,
				success: function(dataResult1){
					var dataResult1 = JSON.parse(dataResult1);
					if(dataResult1.statusCode1==200){
						$("#butsaveCP").removeAttr("disabled");
						$('#changePwForm').find('input:text').val('');
						$("#successCP").show();
						$('#successCP').html('User Password Updated Successfully !'); 						
					}
					else if(dataResult1.statusCode1==201){
					   alert("Error occured !");
					}
					
				}
			});
			}
		}
		else{
			alert('Please fill all the field !');
		}
	});
});