"If" variable has seven characters

admin

Administrator
Staff member
I have a variable called 揑D?

I am trying to write an if else statement in javascript.

The variable id contains only characters between 0-9, A-Z, and a-z.

How would I finish this off this script if I wanted the 搃f?facter to be the variable ID has seven characters:
if (id XXXXXXXX)
{
alert ("Your ID has seven characters");
}
else
{
alert ("Your ID has less or more than seven characters");
}
Thanks for any help.
 
Top