Niceforms and Checkbox changed events

Published by on
Tags:

It seems that the Niceforms JavaScript does not raise the onchange event of the original checkbox when the checkbox image is clicked.

To correct this problem, and assuming you are using jQuery you need to find the inputCheck function in the NiceForms.js file. Then update the el.dummy.click function as follows:

       el.dummy.onclick = function() {
		if(!this.ref.checked) {
			
			this.ref.checked = true;
			$(this.ref).change(); //added
			this.className = "NFCheck NFh";
		}
		else {
		
			this.ref.checked = false;
			$(this.ref).change(); //added
			this.className = "NFCheck";
		}
	}

ASP.NET Form Validation and Jquery

Published by on
Tags:

I had a situation where I wanted a loading icon to appear when the user clicked submit in an ASP.NET form and the button to be hidden. However I didn't want the image to display if the form failed the client side validation.

The solution is to call the Page_ClientValidate method that ASP.NET uses. It takes one parameter which is the name of the validation group the button belongs to.

$(function(){
  var button = $("#<%=button.ClientID%>");
  var loadingImage = $("#loadingImage");
  
  button.click(function(){
    if(Page_ClientValidate("")){
      button.css("display","none");
      loadingImage.css("display","block");   
    }
  });  
});
 

All blogs tagged with ' jquery'

Projects

Have you read?

Simple tag cloud calculator



Blogs by date