Hi All,
I’m having a hard time in getting the last part of this javascript validation.
Basically, if the text box is not 10 digits, throw an alert…
if (document.myform.Global_ID.value==””)
{
alert(“Please enter your Global ID.”)
document.myform.Global_ID.focus();
return false;
}
else if (document.myform.Global_ID.value.charAt(0) ==” ” )
{
alert(“Global ID code cannot begin with a blank space.”)
document.myform.Global_ID.focus()
document.myform.Global_ID.select()
return false;
}
else
{
var Global_ID = document.myform.Global_ID.value;
var cod = parseFloat(Global_ID)
if ((Global_ID!=”+cod)&&(Global_ID!=’0’+cod)&&(Global_ID!=’00’+cod))
{
alert(“Global ID may only contain numbers.”)
document.myform.Global_ID.focus()
document.myform.Global_ID.select()
return false;
}
}
else
{
var ID_Length = document.myform.Global_ID.length;
if ((ID_Length < 10) || (ID_Length > 10))
{
alert(“Global ID must contain 10 digits.”)
document.myform.Global_ID.focus()
document.myform.Global_ID.select()
return false;
}
}