Tag Archives: validate

Validate HTML Checkbox And Radio using jQuery

checkbox-checked




CheckBox HTML checkbox list is slightly different. The main problem is that it can’t be accessed using ID because every checkbox will have different ID. But they share one common attribute which is “name“. So while accessing checkboxes in jQuery, need to use “name” attribute. Let’s declare a HTML checkboxlist. <input type="checkbox" name="technologies" value="jQuery" /> jQuery <br/> <input type="checkbox" name="technologies" value="JavaScript" />JavaScript <br/> <input type="checkbox" name="technologies" value="Prototype" /> Prototype<br/> <input type="checkbox" name="technologies" value="Dojo" /> Dojo<br/> <input type="checkbox" name="technologies" value="Mootools" /> […]

Validate HTML CheckboxList using jQuery

jquery2




HTML checkbox list is slightly different. The main problem is that it can’t be accessed using ID because every checkbox will have different ID. But they share one common attribute which is “name“. So while accessing checkboxes in jQuery, need to use “name” attribute. Let’s declare a HTML checkboxlist. <input type="checkbox" name="technologies" value="jQuery" /> jQuery <br/> <input type="checkbox" name="technologies" value="JavaScript" />JavaScript <br/> <input type="checkbox" name="technologies" value="Prototype" /> Prototype<br/> <input type="checkbox" name="technologies" value="Dojo" /> Dojo<br/> <input type="checkbox" name="technologies" value="Mootools" /> Mootools […]

Validate and Sanitize Data in PHP

sanitize




Data Sanitization and Validation is an important step to maintain highest quality standard of Data Security. Since PHP 5.2.0, data sanitization and validation has been made significantly easier with the introduction of data filtering. Why Sanitize and Validate?? On different web applications, there are sorts of threats related to data security from user-inputs and third-party data. Some data security threats: Cross-Site Scripting (XSS) A form of code injection where a script is injected onto a website from a completely different […]

Validate email address using jQuery

Validate email address using jQuery




This is a very basic functionality to validate the email address. In this post, I will show you how to validate the email address using jQuery. To validate the email address, I have created a separate function which based on email address, returns true or false. Email address validation is done using regular expression. function validateEmail(txtEmail){ var a = document.getElementById(txtEmail).value; var filter = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9]+[a-zA-Z0-9.-]+[a-zA-Z0-9]+.[a-z]{1,4}$/; if(filter.test(a)){ return true; } else{ return false; } }