Total Pageviews

Popular Posts

Monday, October 25, 2010

capslock validation jquery addmethod


use this in jquery.validate.js file and change other places which wanted to change in the file
in
messages:{
uppercase: "Please enter a uppercase.",
}

and
in
classRuleSettings:{

uppercase: {
uppercase: true
},
}

uppercase: function(value,element) {
return this.optional(element) || !/([a-z])/.test(value);
},


and validation scripts
$(document).ready(function() {
$("#form1").validate({
rules: {

txtfirst_name: {
uppercase: true,
required: true
},

}

Thursday, October 14, 2010

HTML php drop down list

can use select option below this it is impotent when editing and display entered data


if ($education == "o/l") {
echo 'selected="selected" ';
} ?>>O/L

Saturday, October 9, 2010

Jquery Phone number validaton

in the jquery.validate.js

inside methode add pone function below

methods: {
phone: function(value) {
var numbers = value.split(/\d/).length - 1;
return (10 <= numbers && numbers <= 20 && value.match(/^(\+){0,1}(\d|\s|\(|\)){10,20}$/)); },
}

under classic url settin
add bellow

classRuleSettings: {

phone: {
phone: true
},}



then in the validation function or class
add

$(document).ready(function() {
$("#form1").validate({
rules: {

// simple rule, converted to {required:true}
txt_email: {// compound rule
required: true,
txt_email: true
},
url: {
url: true
},}

$(document).ready(function() {
$("#form1").validate({
rules: {

// simple rule, converted to {required:true}
txt_email: {// compound rule
required: true,
txt_email: true
},
url: {
url: true
},
txt_mother_age:"Please enter valid Age.",
txt_local_mobile_no:"enter valid number"
}

});
});