473,405 Members | 2,141 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,405 software developers and data experts.

AutoComplete does not work when put focus on that control

Pat
Hi ASP Gurus,
Please help me.
Autocomplete works fine when the control does not have the focus when the
page load.
But when I put the focus on page load, then autocomplete does not work.
I even tried javascript pageload code, but with no success.
<script language ="javascript" type ="text/javascript" >
function focusIt() {
//alert('test');
var mytext =
document.getElementById('<%=txtSearch.ClientID%>') ;
//alert(mytext);
mytext.focus();
}
onload = focusIt;
</script>

What should I do to make it work with focus on it.

Please help, I am stuck on this for some time now.

Thanks Pat.
Oct 31 '08 #1
5 3343
On Oct 31, 12:07*pm, "Pat" <P...@noswpam.comwrote:
Hi ASP Gurus,
Please help me.
Autocomplete works fine when the control does not have the focus when the
page load.
But when I put the focus on page load, then autocomplete does not work.
I even tried javascript pageload code, but with no success.
*<script language ="javascript" type ="text/javascript" >
* * * * * * function focusIt() {
* * * * * * * * //alert('test');
* * * * * * * * var mytext =
document.getElementById('<%=txtSearch.ClientID%>') ;
* * * * * * * * //alert(mytext);
* * * * * * * * mytext.focus();
* * * * * * }
* * * * * * onload = focusIt;
</script>

What should I do to make it work with focus on it.

Please help, I am stuck on this for some time now.

Thanks Pat.

First off, you can just set the focus in server side code with

mycontrol.focus()

It generates the proper script for the focus to happen. But I don't
see how one thing affects the other.

What browser are you talking about? Autocomplete is completely a
browser function.

Oct 31 '08 #2
Pat
txtSearch.Focus() was the first thing I have tried. It did not work.
I am using IE7.

Pat

"Larry Bud" <la**********@yahoo.comwrote in message
news:bc**********************************@t18g2000 prt.googlegroups.com...
On Oct 31, 12:07 pm, "Pat" <P...@noswpam.comwrote:
Hi ASP Gurus,
Please help me.
Autocomplete works fine when the control does not have the focus when the
page load.
But when I put the focus on page load, then autocomplete does not work.
I even tried javascript pageload code, but with no success.
<script language ="javascript" type ="text/javascript" >
function focusIt() {
//alert('test');
var mytext =
document.getElementById('<%=txtSearch.ClientID%>') ;
//alert(mytext);
mytext.focus();
}
onload = focusIt;
</script>

What should I do to make it work with focus on it.

Please help, I am stuck on this for some time now.

Thanks Pat.

First off, you can just set the focus in server side code with

mycontrol.focus()

It generates the proper script for the focus to happen. But I don't
see how one thing affects the other.

What browser are you talking about? Autocomplete is completely a
browser function.


Oct 31 '08 #3
What didn't work? The focus, or the autocomplete?

Are you sure autocomplete isn't turned off in the browser?

On Oct 31, 2:09*pm, "Pat" <P...@noswpam.comwrote:
txtSearch.Focus() was the first thing I have tried. It did not work.
I am using IE7.

Pat

"Larry Bud" <larrybud2...@yahoo.comwrote in message

news:bc**********************************@t18g2000 prt.googlegroups.com...
On Oct 31, 12:07 pm, "Pat" <P...@noswpam.comwrote:


Hi ASP Gurus,
Please help me.
Autocomplete works fine when the control does not have the focus when the
page load.
But when I put the focus on page load, then autocomplete does not work.
I even tried javascript pageload code, but with no success.
<script language ="javascript" type ="text/javascript" >
function focusIt() {
//alert('test');
var mytext =
document.getElementById('<%=txtSearch.ClientID%>') ;
//alert(mytext);
mytext.focus();
}
onload = focusIt;
</script>
What should I do to make it work with focus on it.
Please help, I am stuck on this for some time now.
Thanks Pat.

First off, you can just set the focus in server side code with

mycontrol.focus()

It generates the proper script for the focus to happen. *But I don't
see how one thing affects the other.

What browser are you talking about? *Autocomplete is completely a
browser function.- Hide quoted text -

Oct 31 '08 #4
Pat
Everything works if txtSearch does not have the focus when the page load.
It quit working the moment I put focus on that control at page load.
It works again if I comment that code.

Don't work means I do not see the dropdown.

Pat
"Larry Bud" <la**********@yahoo.comwrote in message
news:54**********************************@c2g2000p ra.googlegroups.com...
What didn't work? The focus, or the autocomplete?

Are you sure autocomplete isn't turned off in the browser?

On Oct 31, 2:09 pm, "Pat" <P...@noswpam.comwrote:
txtSearch.Focus() was the first thing I have tried. It did not work.
I am using IE7.

Pat

"Larry Bud" <larrybud2...@yahoo.comwrote in message

news:bc**********************************@t18g2000 prt.googlegroups.com...
On Oct 31, 12:07 pm, "Pat" <P...@noswpam.comwrote:


Hi ASP Gurus,
Please help me.
Autocomplete works fine when the control does not have the focus when
the
page load.
But when I put the focus on page load, then autocomplete does not work.
I even tried javascript pageload code, but with no success.
<script language ="javascript" type ="text/javascript" >
function focusIt() {
//alert('test');
var mytext =
document.getElementById('<%=txtSearch.ClientID%>') ;
//alert(mytext);
mytext.focus();
}
onload = focusIt;
</script>
What should I do to make it work with focus on it.
Please help, I am stuck on this for some time now.
Thanks Pat.

First off, you can just set the focus in server side code with

mycontrol.focus()

It generates the proper script for the focus to happen. But I don't
see how one thing affects the other.

What browser are you talking about? Autocomplete is completely a
browser function.- Hide quoted text -


Oct 31 '08 #5
There could be some confliction btw the scipts.
Try investigating
Patrick

"Pat" <Pa*@nospaml.comwrote in message
news:eD*************@TK2MSFTNGP03.phx.gbl...
Everything works if txtSearch does not have the focus when the page load.
It quit working the moment I put focus on that control at page load.
It works again if I comment that code.

Don't work means I do not see the dropdown.

Pat
"Larry Bud" <la**********@yahoo.comwrote in message
news:54**********************************@c2g2000p ra.googlegroups.com...
What didn't work? The focus, or the autocomplete?

Are you sure autocomplete isn't turned off in the browser?

On Oct 31, 2:09 pm, "Pat" <P...@noswpam.comwrote:
>txtSearch.Focus() was the first thing I have tried. It did not work.
I am using IE7.

Pat

"Larry Bud" <larrybud2...@yahoo.comwrote in message

news:bc**********************************@t18g200 0prt.googlegroups.com...
On Oct 31, 12:07 pm, "Pat" <P...@noswpam.comwrote:


Hi ASP Gurus,
Please help me.
Autocomplete works fine when the control does not have the focus when
the
page load.
But when I put the focus on page load, then autocomplete does not work.
I even tried javascript pageload code, but with no success.
<script language ="javascript" type ="text/javascript" >
function focusIt() {
//alert('test');
var mytext =
document.getElementById('<%=txtSearch.ClientID%>') ;
//alert(mytext);
mytext.focus();
}
onload = focusIt;
</script>
What should I do to make it work with focus on it.
Please help, I am stuck on this for some time now.
Thanks Pat.

First off, you can just set the focus in server side code with

mycontrol.focus()

It generates the proper script for the focus to happen. But I don't
see how one thing affects the other.

What browser are you talking about? Autocomplete is completely a
browser function.- Hide quoted text -



Nov 4 '08 #6

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

Similar topics

1
by: Georg Scholz | last post by:
Hello, The class "Control" contains a documented Property "ControlType". So for example, in a form, you can write code like this: Dim c as control set c = me.Controls("textbox1") if...
1
by: moondaddy | last post by:
I have a form for entering a user's address and all fields have a required validating control associated with them and the error msg for each field displays right next to it. The normal behavior...
1
by: Mad Scientist Jr | last post by:
I have a textbox control (for simplicity call it Text1) with autopostback turned on. It has a couple validators: RequiredFieldValidator_Text1 RegularExpressionValidator_Text1 The Text1...
19
by: Bernie Yaeger | last post by:
Everyone misses the point on this - what we need is a combobox autocomplete that is a dropdownlist only. When in dropdown mode, you can enter text - making that autocomplete is trivial. But when...
0
by: Matewis | last post by:
Once you’ve populated a ComboBox with items and your AutoComplete – SuggestAppend properties are enabled the following is a problem. When you select an item where a duplicate item exists and...
8
by: nil | last post by:
Hello all, It's urgent... i want to add autocomplete textbox facility in my application like google. as you type it suggests option to the user..i want the same kind of facility...i know i...
1
by: wkerplunk | last post by:
Below is what I have build with several different languages. It works great but I need help, I am stuck. When you click on an item in the dropdown autocomplete div it does a mousedown function...
3
by: John | last post by:
AC2007 I changed my combo's row source and then the autocomplete stopped working. The combo is two columns, bound to the first. First column is primary key (ID). Second column is a...
0
by: Builder | last post by:
I made a simple app to test Leave focus event and AutoComplete functionality on the text box control. I added 2 text box controls on the blank form. Then I added Leave focus event handlers for...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.