Check only digits in TExtBox using Javascript

//TextBox indicates the ID of the TextBox in the form
function checknum(TextBox)
{
var str=TextBox.value;
for(i=0;i < str.length;i++)
{
var num=str.charAt(i);
if((num>="0")&&(num<="9"))
{
}
else
{
return(false);
}
}
}

Check Email format using Javascript

function validatemail()
{

var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var address = document.form1.txtaltermail.value;
if(reg.test(address) == false)
{
return false;
}
else
{
return(true);
}
}
Category
Monthly archive
Latest trackbacks
Latest comments
Profile

Author:DotnetWorld
Welcome to FC2!

Latest journals
Link
Display RSS link.
Search form
Friend request form

Want to be friends with this user.

Powered by FC2 BLOG

Let's start blogging!!

Powered by FC2 Blog