hi,
For some reason the alert functions in my code seem to be not working correctly and i cant work out why… The first two work but the remaining ones dont. why is this??? Have a got some syntax wrong here??
[code]
var temp = document.callmeback_form.telephone.value;
if (temp==””)
{
alert(“Enter a valid UK Phone number including area code”);
document.callmeback_form.telephone.focus();
document.callmeback_form.telephone.style.background = ‘#FF8600’;
document.callmeback_form.telephone.style.border = “1px solid #A5ACB2”;
document.callmeback_form.telephone.style.width = “132px”;
document.callmeback_form.telephone.style.height = “15px”;
return false;
}
if (!temp.match(/^(+44[0-9]{10}|0044[0-9]{10}|0[0-9]{10})$/) )
{
if (temp.match(/^(+44)$/) && temp.length < 13)
{
alert(“The number you have entered with this prefix (+44) is too short, please check and try again”);
return false;
}
if (temp.match(/^(+44)$/) && temp.length > 13)
{
alert(“The number you have entered with this prefix (+44) is too long, please check and try again”);
return false;
}
if (temp.match(/^( 044)$/) && temp.length < 14)
{
alert(“The number you have entered with this prefix (0044) is too short, please check and try again”);
return false;
}
if (temp.match(/^( 044)$/) && temp.length > 14)
{
alert(“The number you have entered with this prefix (0044) is too long, please check and try again”);
return false;
}
document.callmeback_form.telephone.focus();
document.callmeback_form.telephone.style.background = ‘#FF8600’;
document.callmeback_form.telephone.style.border = “1px solid #A5ACB2”;
document.callmeback_form.telephone.style.width = “132px”;
document.callmeback_form.telephone.style.height = “15px”;
return false;
}
?
Thanks in advance. Dan