Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: SetFocus


Message #1 by "Kennan Ingalsbe" <kingals@k...> on Fri, 28 Sep 2001 20:57:47
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
Message #2 by Anupama Nallari <ANallari@p...> on Fri, 28 Sep 2001 15:41:55 -0500
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


  Return to Index