I would like to share my knowledge to everyone through this blog. Most of my posts will be some simple tips or codes which became helpful for me while coding. Mainly the posts will contain code fragments in JSP, Struts2, HTML, CSS , Java Script and J Querry
Thursday, 28 June 2012
Tuesday, 12 June 2012
LESS - The dynamic stylesheet language
LESS extends CSS with dynamic behavior such as variables, mixins, operations and functions. LESS runs on both the client-side (Chrome, Safari, Firefox) and server-side, with Node.js and Rhino
Follw the link to know more about LESS
Wednesday, 6 June 2012
Password validation using java script
minimum 1 special charactor
min limit 6 max limit 10
HTML
<label for="password"> password</label>
<input name="password" type="text" id="password" onblur="chkit();" maxlength="10" />
Java Script
function chkit()
{
var password=document.getElementById('password').value;
var pattern=/^([a-z A-Z 0-9 - _ . @ # ]*[- _ . @ # ][a-z A-Z 0-9 - _ . @ # ]*)$/;
if(password!="")
{
if(password.length>5)
{
if(!pattern.test(password))
{
alert('pw not in format');
}
else
{
alert('pw In format');
}
}
else
{
alert('pw not In format');
}
}
}
Live Demo
min limit 6 max limit 10
HTML
<label for="password"> password</label>
<input name="password" type="text" id="password" onblur="chkit();" maxlength="10" />
Java Script
function chkit()
{
var password=document.getElementById('password').value;
var pattern=/^([a-z A-Z 0-9 - _ . @ # ]*[- _ . @ # ][a-z A-Z 0-9 - _ . @ # ]*)$/;
if(password!="")
{
if(password.length>5)
{
if(!pattern.test(password))
{
alert('pw not in format');
}
else
{
alert('pw In format');
}
}
else
{
alert('pw not In format');
}
}
}
Live Demo
Subscribe to:
Posts (Atom)