TextField focus and select all : TextField : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » TextField »

 

TextField focus and select all



<html>
<head>
<script language="JavaScript">
<!--
function checkField(formName)  {
  if (formName.f1.value != "Joe") {
     document.forms[0].f1.focus();
     document.forms[0].f1.select();
  }
}
//-->
</script>
</head>
<body>
<form>
<pre>
Field1 <input name="f1" onBlur="checkField(this.form)"><br>
Field2 <input name="f2">
</pre>
</form>
</body>
</html>

           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Form Control
» TextField