asp_web_howto thread: SetFocus
I need to set the focus on a text field on my page. How would I write this in a If..Then statement that is ASP coding? Kennan
You can do it in the following manner
In the asp code i am checking to see if my text box is empty if it is i am
writing javascript to set focus.
//Asp code
%<if trim(Request.Form("searchstring"))="" then%>
//Javascriptcode
<SCRIPT LANGUAGE=javascript>
<!--
window.alert("Please enter a search string.")
window.kbase.searchstring.focus()
//-->
</SCRIPT>
Hope that helps,
Anu
|





