2 panels, 1 Body, 1 "SetFocus"

eramgarden

Contributor
Joined
Mar 8, 2004
Messages
579
Dont know how to do this:

I have a page with 2 panels on it. If I login with Mode1, Panel1 is displayed. If I login with Mode2, Panel2 is displayed.

I want to set foucs on a textbox that is displayed in EACH panel

For example, I have a textbox in Panel1 named txtIncid and one in panel2, named txtIncid8.

This is what I did but It doesnt work because I always pass it the same value:
Code:
<script LANGUAGE="JavaScript">
		 function setFocus(x)
            {
               
                if (x=="txtIncid"){
               document.Form1.elements[x].focus();
                }
                else{
                
                document.Form1.elements['txtIncid8'].focus();
                    }
               }
                       
         
		</script>

and then In the Body, I have this:
Code:
<body MS_POSITIONING="GridLayout" OnLoad="setfocus('txtIncid')">

any ideas?
 
Back
Top