auchampach
Oct 31st 2008, 6:36 am
Hi all, I am trying to validate weather or not a text box contains any text or not. I am pretty certain my javascript works, except I don't think my javascript is able to see my input field. Any ideas why it can't read it? My other js works.
//Javascript
function CharCount()
{
valid = true;
if (document.uspworkphn4.value == "" )
{
valid = false;
}
else
{
alert('The Extension field is meant for non-Direct Dial branches only. \n If you have a Direct Dial (10-digit) number that rings directy \nto your phone, please leave the extension number blank.');
}
}
//HTML
<input type="input" id="uspworkphn4" name="uspworkphn4" onblur="CharCount();" OnKeypress="return isNumberKey(event)" value="#uspworkphn4#" size="5" maxlength="10" />
Edit/Delete Message
//Javascript
function CharCount()
{
valid = true;
if (document.uspworkphn4.value == "" )
{
valid = false;
}
else
{
alert('The Extension field is meant for non-Direct Dial branches only. \n If you have a Direct Dial (10-digit) number that rings directy \nto your phone, please leave the extension number blank.');
}
}
//HTML
<input type="input" id="uspworkphn4" name="uspworkphn4" onblur="CharCount();" OnKeypress="return isNumberKey(event)" value="#uspworkphn4#" size="5" maxlength="10" />
Edit/Delete Message