How to set first focus on specific textbox?


Ad

Advertisements

O

Onin Tayson

Hi ABC,

you can use the <body>'s onload event. i.e.

<body onload="javascript: document.form1.TextBox1.focus();">

HTH,
 
L

Leon Mayne [MVP]

ABC said:
How to set first focus on specific textbox?

You can do it with javascript. Make sure your form tag has a name attibute,
e.g. for the example below name="userform"

<script language="javascript" type="text/javascript">
<!--
document.userform.textboxname.focus();
//-->
</script>

You can't do it with server-side code though.
 
Ad

Advertisements

B

bienwell

Hi,

How can we focus on the field after the form validation. For example, user
enter wrong data type on the field after validation
(RegularExpressionvalidator), and I'd like to focus on that field again ???

=======================================================
 

Top