ASP FormsAs of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
There are a lot of things you need/want to do with a web page that APS can't do. That's why you need a good working knowledge of javascript and HTML to get everything to work well. Focus is a good example. ASP.NET takes care of this handily, but not ASP.
If all you want to do is set the focus to a particular form field when the page is rendered, do it in the <body> tag with 'onload'. Example:
<body onload='document.frmLogin.username.focus();'>
Originally posted by dwithrow
If all you want to do is set the focus to a particular form field when the page is rendered, do it in the <body> tag with 'onload'. Example:
<body onload='document.frmLogin.username.focus();'>
Yes I am aware of the need to learn Java but dont I need a small scxript to utilise <body onload='document.frmLogin.username.focus();'>
in Vanilla ASP
No need for any script. You're executing focus() from the onload property of the page body. Just make sure you have a form and controls on that form -
<body onload='document.<your form name>.<your input text box>.focus();'>
quote:Originally posted by dwithrow
No need for any script. You're executing focus() from the onload property of the page body. Just make sure you have a form and controls on that form -
<body onload='document.<your form name>.<your input text box>.focus();'>
Thanks a lot that fixed it without all the Java stuff