Friday 8 February 2013

HTML5 Table Alignment


// cellpadding
th, td { padding: 5px; }

// cellspacing
table { border-collapse:separate; border-spacing: 5px; } // cellspacing="5"
table { border-collapse:collapse; border-spacing: 0; }   // cellspacing="0"

// valign
th, td { vertical-align: top; }

// align (center)
table { margin: 0 auto; }

Wednesday 2 January 2013

JQuery Input text box Numeric Validation Integer and Decimal



///////////////////////////////////////IntegerValidation ///////////////////////////////////////////////////////
            $("#txtRequestedDays").keyup(function (e) {
                if (/\D/g.test(this.value)) {
                    // Filter non-digits from input value.
                    this.value = this.value.replace(/\D/g, '');
                }
            });


///////////////////////////////////////Decimal Validation ///////////////////////////////////////////////////////
            $("#txtRequestedDays").keyup(function () {
                if (this.value != this.value.replace(/[^0-9\.]/g, '')) {
                    this.value = this.value.replace(/[^0-9\.]/g, '');
                }
            });