T tfs Jun 28, 2004 #1 How do I set a field on my screen to get focus when the page opens? Thanks, Tom
D Darren Clark Jun 28, 2004 #2 could try a generic option function init() { try { document.forms[0].elements[0].setFocus(); } } tfs said: How do I set a field on my screen to get focus when the page opens? Thanks, Tom Click to expand...
could try a generic option function init() { try { document.forms[0].elements[0].setFocus(); } } tfs said: How do I set a field on my screen to get focus when the page opens? Thanks, Tom Click to expand...
K Ken Cox [Microsoft MVP] Jun 28, 2004 #3 "FirstFocus Control This control creates the proper javascript to give focus to control after the page has loaded." http://www.metabuilders.com/Tools/FirstFocus.aspx
"FirstFocus Control This control creates the proper javascript to give focus to control after the page has loaded." http://www.metabuilders.com/Tools/FirstFocus.aspx
S Saravana [MVP] Jun 28, 2004 #4 Check out this faq, http://www.extremeexperts.com/Net/CodeSnippets/SettingFocustoElementAfterPos tback.aspx -- Saravana Microsoft MVP - ASP.NET www.extremeexperts.com tfs said: How do I set a field on my screen to get focus when the page opens? Thanks, Tom Click to expand...
Check out this faq, http://www.extremeexperts.com/Net/CodeSnippets/SettingFocustoElementAfterPos tback.aspx -- Saravana Microsoft MVP - ASP.NET www.extremeexperts.com tfs said: How do I set a field on my screen to get focus when the page opens? Thanks, Tom Click to expand...
T tfs Jun 28, 2004 #5 I tried the following, but it didn't seem to work. <script language="JavaScript" > document.getElementById("tfPassword").focus(); </script> <div align="center"> <p><span class="HeaderText">Please enter the password to process these pages</span></p> <form name="_ctl1" method="post" Click to expand... action="TMPluy1i8bi.aspx" id="_ctl1"> <input type="hidden" name="__VIEWSTATE" Click to expand... value="dDwtMTU3MDA0ODk5NDs7PhcziXEHc3pyzzr86qHlt50NG4LD" /> <table width="230" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="35%" Click to expand... class="BodyText">Password: said: <td width="65%"><input Click to expand... name="tfPassword" type="text" id="tfPassword" /> said: </tr> Click to expand... I am running this in an asp.net page running vb.net. Is there a problem running javascript with this? Thanks, Tom.
I tried the following, but it didn't seem to work. <script language="JavaScript" > document.getElementById("tfPassword").focus(); </script> <div align="center"> <p><span class="HeaderText">Please enter the password to process these pages</span></p> <form name="_ctl1" method="post" Click to expand... action="TMPluy1i8bi.aspx" id="_ctl1"> <input type="hidden" name="__VIEWSTATE" Click to expand... value="dDwtMTU3MDA0ODk5NDs7PhcziXEHc3pyzzr86qHlt50NG4LD" /> <table width="230" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="35%" Click to expand... class="BodyText">Password: said: <td width="65%"><input Click to expand... name="tfPassword" type="text" id="tfPassword" /> said: </tr> Click to expand... I am running this in an asp.net page running vb.net. Is there a problem running javascript with this? Thanks, Tom.
H Holly Jun 28, 2004 #6 I used this: http://www.reflectionit.nl/InitialFocus.aspx Holly -----Original Message----- Check out this faq, http://www.extremeexperts.com/Net/CodeSnippets/SettingFoc ustoElementAfterPos tback.aspx -- Saravana Microsoft MVP - ASP.NET www.extremeexperts.com How do I set a field on my screen to get focus when the page opens? Thanks, Tom Posted Via Usenet.com Premium Usenet Newsgroup Services ------------------------------------------------------- --- ------------------------------------------------------- --- color] . Click to expand... Click to expand...
I used this: http://www.reflectionit.nl/InitialFocus.aspx Holly -----Original Message----- Check out this faq, http://www.extremeexperts.com/Net/CodeSnippets/SettingFoc ustoElementAfterPos tback.aspx -- Saravana Microsoft MVP - ASP.NET www.extremeexperts.com How do I set a field on my screen to get focus when the page opens? Thanks, Tom Posted Via Usenet.com Premium Usenet Newsgroup Services ------------------------------------------------------- --- ------------------------------------------------------- --- color] . Click to expand... Click to expand...