Thursday, May 26, 2005
SET FOCUS ON A CONTROL IN ASP.NET PAGES
Write the following script in the HTML Body TAG
<script language="JavaScript">
<!--function SetFocus()
{
document.Form2['Button1'].focus();
}
window.onload = SetFocus;//-->
</script>
Form2 - is the form ID Button1 - is the Control name on which focus has to be set
ak_vajawat@yahoo.com
<script language="JavaScript">
<!--function SetFocus()
{
document.Form2['Button1'].focus();
}
window.onload = SetFocus;//-->
</script>
Form2 - is the form ID Button1 - is the Control name on which focus has to be set
ak_vajawat@yahoo.com