I couldn't find any HTA-specific newsgroups so please forgive me if this
post isn't relevant to this newsgroup.

I have a an HTA with embedded vbs and wsh. The HTA has 2 textboxes and a
submit button and I'd like the focus to be on the first textbox when the HTA
is launched (so the user doesn't have to click or tab to get there). Anyone
know how to do this? Here's the code for the first textbox:

<input type="text" name="login" size="30" tabindex="1">

If there's a more appropriate newsgroup for this question please let me
know.

Thanks...

Re: Simple HTA question by W

W
Mon May 08 19:44:31 CDT 2006

Sub window_OnLoad
dim form
Set form = document.xxxForm * Where xxxform is the name of the HTLM
form.
form.login.value = ""
form.login.focus * Here is where you set focus
on the first field
end sub

You can have subs like Login_OnFocus, Login_OnBlur, Login_OnChange,
Login_OnClick and perform whatever tasks are needed based on the current
condition.

Also you might want to look at
http://www.microsoft.com/technet/scriptcenter/hubs/htas.mspx. There are
some really great tips on creating HTA's.

Hope this helps.

"D.P. Roberts" <DProberts@pbride.com> wrote in message
news:Oe1X31vcGHA.5116@TK2MSFTNGP04.phx.gbl...
>I couldn't find any HTA-specific newsgroups so please forgive me if this
>post isn't relevant to this newsgroup.
>
> I have a an HTA with embedded vbs and wsh. The HTA has 2 textboxes and a
> submit button and I'd like the focus to be on the first textbox when the
> HTA is launched (so the user doesn't have to click or tab to get there).
> Anyone know how to do this? Here's the code for the first textbox:
>
> <input type="text" name="login" size="30" tabindex="1">
>
> If there's a more appropriate newsgroup for this question please let me
> know.
>
> Thanks...
>



Re: Simple HTA question by D

D
Tue May 09 14:11:44 CDT 2006

Thanks, that did it!

"W C Hull" <substitute1stInitial2ndInitialLastName51@hotmaill.com> wrote in
message news:%23Dp90GwcGHA.4892@TK2MSFTNGP02.phx.gbl...
> Sub window_OnLoad
> dim form
> Set form = document.xxxForm * Where xxxform is the name of the HTLM
> form.
> form.login.value = ""
> form.login.focus * Here is where you set
> focus on the first field
> end sub
>
> You can have subs like Login_OnFocus, Login_OnBlur, Login_OnChange,
> Login_OnClick and perform whatever tasks are needed based on the current
> condition.
>
> Also you might want to look at
> http://www.microsoft.com/technet/scriptcenter/hubs/htas.mspx. There are
> some really great tips on creating HTA's.
>
> Hope this helps.
>
> "D.P. Roberts" <DProberts@pbride.com> wrote in message
> news:Oe1X31vcGHA.5116@TK2MSFTNGP04.phx.gbl...
>>I couldn't find any HTA-specific newsgroups so please forgive me if this
>>post isn't relevant to this newsgroup.
>>
>> I have a an HTA with embedded vbs and wsh. The HTA has 2 textboxes and a
>> submit button and I'd like the focus to be on the first textbox when the
>> HTA is launched (so the user doesn't have to click or tab to get there).
>> Anyone know how to do this? Here's the code for the first textbox:
>>
>> <input type="text" name="login" size="30" tabindex="1">
>>
>> If there's a more appropriate newsgroup for this question please let me
>> know.
>>
>> Thanks...
>>
>
>