Setting Focus in a Tex Box into a Web User Control

see07

Regular
Joined
Apr 16, 2004
Messages
78
Location
Mexico City
:D Hello:
Somebody knows how can I set focus in a text box into a web user control embedded into another web user control?
I’ll appreciate all your suggestions.
A.L.
 
Finally y found the answer:
I put the next javascript into web user control where I was placed Text Box where I desired put the focus:
<HEAD>
<SCRIPT LANGUAGE =”JavaScript”>
function putFocus(FormInst,elementInst)
{
if(document.forms.length > 0)
{
document.forms[formInst].elements[elementInst].focus();
}
}
</SCRIPT>
</HEAD>
<BODY onLoad = “putFocus(0,3);”>

Where 3 is the 3rd element, (3rd TextBox, begin counting from 1 for 1st. Text Box no matter this was on 1st. Web User Control, and thus…) where I want to set focus.
 
Back
Top