From: John on
I'm rendering a Html Select to auto dropdown when created, it works but
losses it's normal mouseover effect of highlighting each row and the type a
letter to move to a macthing row functions.
If I try to type or click it to give it focus again it just fires the
changed event.
Any Ideas as to how I can modify this to function properly?

var formFld = document.createElement('select')
formFld.setAttribute('size', '15')
formFld.setAttribute('id', Drop)
formFld.style.position= 'absolute'
formFld.style.marginTop= '-10px'
formFld.name = Drop
formFld.style.width=300

var ce = document.getElementById(cel)
ce.appendChild(formFld)
formFld.focus()

Thanks John


From: bruce barker on
you are setting the focus before the control is fully created and
displayed. try:

ce.appendChild(formFld);
window.setTimeout(function(){formFld.focus();});


-- bruce (sqlwork.com)

John wrote:
> I'm rendering a Html Select to auto dropdown when created, it works but
> losses it's normal mouseover effect of highlighting each row and the type a
> letter to move to a macthing row functions.
> If I try to type or click it to give it focus again it just fires the
> changed event.
> Any Ideas as to how I can modify this to function properly?
>
> var formFld = document.createElement('select')
> formFld.setAttribute('size', '15')
> formFld.setAttribute('id', Drop)
> formFld.style.position= 'absolute'
> formFld.style.marginTop= '-10px'
> formFld.name = Drop
> formFld.style.width=300
>
> var ce = document.getElementById(cel)
> ce.appendChild(formFld)
> formFld.focus()
>
> Thanks John
>
>
From: John on
Thanks for your reply,
I applied your method but it is still the same result, instead of a
highlight I get a just a dotted border around the first row and no response
on mouseover to other rows. Thanks for your input though I gave it a 2
second delay, which was long enough for me to see the focus to be appiled.

John

"bruce barker" <nospam(a)nospam.com> wrote in message
news:OaDZ5Mv3IHA.4988(a)TK2MSFTNGP02.phx.gbl...
> you are setting the focus before the control is fully created and
> displayed. try:
>
> ce.appendChild(formFld);
> window.setTimeout(function(){formFld.focus();});
>
>
> -- bruce (sqlwork.com)
>
> John wrote:
>> I'm rendering a Html Select to auto dropdown when created, it works but
>> losses it's normal mouseover effect of highlighting each row and the type
>> a letter to move to a macthing row functions.
>> If I try to type or click it to give it focus again it just fires the
>> changed event.
>> Any Ideas as to how I can modify this to function properly?
>>
>> var formFld = document.createElement('select')
>> formFld.setAttribute('size', '15')
>> formFld.setAttribute('id', Drop)
>> formFld.style.position= 'absolute'
>> formFld.style.marginTop= '-10px'
>> formFld.name = Drop
>> formFld.style.width=300
>>
>> var ce = document.getElementById(cel)
>> ce.appendChild(formFld)
>> formFld.focus()
>>
>> Thanks John
>>

 | 
Pages: 1
Prev: SQL to asp.net using c#
Next: Deployment