This script is a PHP written component. The
purpose of this script is to format and validate Social Security
Numbers in a form field. The script strips all non-numeric characters
and then validates that the remaining characters are sufficient.
Validate Social Security
Setting the focus, or for beginners, automatically placing the
cursor in one of the fields of your HTML form, is fairly simple. There
are two common methods. The first and most common is to use the
<BODY> tag’s onload event.
Ex.
<body onload="document.FORMNAME.FIELDNAME.focus();">
However, there are times that you cannot use the body tag and you
need another solution. As an alternative to the onLoad event, you can
use the setTimeout fuction in JavaScript to wait half a second and then
set the focus.
Ex.
<script>
setTimeout(’document.FORMNAME.FIELDNAME.focus()’,500);
</script>
In both cases, you would replace FORMNAME with the value of the name
attribute in the <form> tag. You replace FIELDNAME with the value
of the name attribute in the <input> tag of the targeted field.
|