Background - I'm a novice programmer, have some experience with VB, VBA, and VBScript.
JavaScript is new to me. SO..... I'm trying to do the following pseudocode:
if (document.frmComments.ContactZipCode.LENGTH OF USER'S INPUT <5 OR IF IT'S GREATER THAN 10 DIGITS)
{
alert ("Please double check your zip code entry."
return false;
document.frmComments.ContactZip.focus
}
Side notes (may or may not matter):
ContactZipCode is just a text box on a form, defined as:
Zip: <INPUT NAME="AgencyZip" TYPE="TEXT" SIZE="10" ALIGN="left"><P>
I tried this code, but "length" is not a recognized property, and "value" doesn't seem to give me what I need
else if (document.frmComments.ContactZip.length <5)
{
alert ("Please double check your zip code entry."
return false;
document.frmComments.ContactZip.focus
}
Any help is sincerely appreciated. I ask lots of questions, but I take care to be clear, and always post back results and resolutions so they can help others.
JavaScript is new to me. SO..... I'm trying to do the following pseudocode:
if (document.frmComments.ContactZipCode.LENGTH OF USER'S INPUT <5 OR IF IT'S GREATER THAN 10 DIGITS)
{
alert ("Please double check your zip code entry."
return false;
document.frmComments.ContactZip.focus
}
Side notes (may or may not matter):
ContactZipCode is just a text box on a form, defined as:
Zip: <INPUT NAME="AgencyZip" TYPE="TEXT" SIZE="10" ALIGN="left"><P>
I tried this code, but "length" is not a recognized property, and "value" doesn't seem to give me what I need
else if (document.frmComments.ContactZip.length <5)
{
alert ("Please double check your zip code entry."
return false;
document.frmComments.ContactZip.focus
}
Any help is sincerely appreciated. I ask lots of questions, but I take care to be clear, and always post back results and resolutions so they can help others.