HKFuey
asked on
Asp set focus on text box
I have this code: -
On opening the page or pressing update I want the focus on 'Dnote'
Does anyone know how to do this?
Ps. KIS I'm new at this!
<html>
<head>
<meta name="GENERATOR" content="Microsoft Developer Studio"/>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>Serials</title>
</head>
<body onload="setFocus('Dnote')" bgcolor="#CEE3F6" text="#000000">
<form name="Serial" action="Serials.asp" method="post">
<table width="60%" border="0" align="left">
<tr><td width="10%"></td><td><input name="Add" type="submit" value="Update" onclick="setFocus('Dnote')"/></td></tr>
<tr><td width="50%"></td></tr>
<tr><td width="10%"></td><td width="50%">Scan Dispatch Note Number</td></tr>
<tr><td width="10%"></td><td><input name="Dnote" type="text" maxlength="30" size="30"/></td></tr>
<tr><td width="10%"></td><td width="50%">Scan Serial</td></tr>
<tr><td width="10%"></td><td><input type="text" name="Serial" id="Serial" size="30"/></td></tr>
<tr><td width="10%"></td><td width="50%"><%=iMsg%></td></tr>
</table>
</form>
</body>
</html>
On opening the page or pressing update I want the focus on 'Dnote'
Does anyone know how to do this?
Ps. KIS I'm new at this!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks padas your first suggestion works great and thanks for the extra info!!
<script type="text/javascript" language="JavaScript">
document.forms['Serial'].e
</script>
Since submitting is the same as refreshing your page, this will work either way.