473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

HTML select auto drops down but losses highlight

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
Jul 4 '08 #1
3 1510
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

Jul 5 '08 #2
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" <no****@nospam.comwrote in message
news:Oa**************@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
Jul 6 '08 #3
I changed my event to onclick instead of onchange and added this to your
method and it is working, thanks again.

window.setTimeout(function(){formFld.focus(), formFld.selectedIndex = 0;});

John

"John" <no*@non.comwrote in message
news:ev**************@TK2MSFTNGP02.phx.gbl...
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" <no****@nospam.comwrote in message
news:Oa**************@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

Jul 6 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Eric Trav | last post by:
Hello, I am using mozilla and javascript to change the style background color for my select with onfocus() and back to white with onblur(). When i process onfocus(); i have to click on the...
4
by: philaphan80 | last post by:
Hello, I'm trying to dynamically load a list of teams into a SELECT field (dropdown / combo box) when a user clicks on the field. (The teams are pre-loaded into JS arrays via ASP/SQL -- not...
3
by: John Morgan | last post by:
I am using a database to populate a drop down list using myDropDownList.DataSource = myCmd.ExecuteReader myDropDownList.DataBind() That works alright and a few lines later in the code I wish...
1
by: Lonnie Princehouse | last post by:
I plan on writing some documentation that will consist of blocks of commentary with interspersed snippets of syntax-colored Python code and the occaisional image. Does anyone know of a package...
4
by: christinashaver | last post by:
Hi there, I am putting together a blog currently located at dewyapplebottom.squarespace.com . Using the http://www.alistapart.com/articles/dropdowns/ , I created a pretty nice looking navigation...
8
by: rn5a | last post by:
I have a HTML page named Index.html which is divided into 3 frames. The URL of 2 of the frames are HTML pages but the 3rd frame houses a ASP page. Now when I go to Windows Explorer, navigate to...
2
by: justplain.kzn | last post by:
Hi, I have a table with dynamic html that contains drop down select lists and readonly text boxes. Dynamic calculations are done on change of a value in one of the drop down select lists. ...
1
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.