I know that I can get the name or the value of a text box in javascript by typing myField.name / myField.value. My question is: Is it possible to have the value of the maxlength of a text box? If so, how can I do that??
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<script language="JavaScript">
function showlength()
{
if (document.myForm.ALotOffText.value.length == 20)
alert(document.myForm.ALotOffText.value.length);
}
function totallength()
{
alert(document.myForm.ALotOffText.value.length);
}
</script>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.