| | |
textbox suggest
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2007
Posts: 33
Reputation:
Solved Threads: 0
Hi friends
First of all I would like to thank people here on Daniweb for helping me whenever I need help. I am hopefull that now also all of you will help me. Today I got a special scenario which I am applying in my application.
I have 2 text boxes to enter zipcode, In first text box when ever user enters some data and presses tab and on getting focus on the second textbox, the second textbox must show data based on the values entered in the first textbox like what we see in google suggest.
For example when user enters 5 digit zipcode in 1st textbox & presses tab key the focus will be on 2nd textbox and immediately 2nd textbox must show names of peoples based on the zipcode entered in 1st textbox, like how we see in google suggest.
For further clarification please mail me back. Hope some one will help me. Thanks in advance
Thanks
wajid
First of all I would like to thank people here on Daniweb for helping me whenever I need help. I am hopefull that now also all of you will help me. Today I got a special scenario which I am applying in my application.
I have 2 text boxes to enter zipcode, In first text box when ever user enters some data and presses tab and on getting focus on the second textbox, the second textbox must show data based on the values entered in the first textbox like what we see in google suggest.
For example when user enters 5 digit zipcode in 1st textbox & presses tab key the focus will be on 2nd textbox and immediately 2nd textbox must show names of peoples based on the zipcode entered in 1st textbox, like how we see in google suggest.
For further clarification please mail me back. Hope some one will help me. Thanks in advance
Thanks
wajid
•
•
Join Date: Jul 2008
Posts: 10
Reputation:
Solved Threads: 0
I think this can be done by setting autopostback of the 1st text box to true.
This should work. Try it
ASP.NET Syntax (Toggle Plain Text)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Me.TextBox1.AutoPostBack = True End Sub Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged If (Me.TextBox1.Text = "whatever text required") Then Me.TextBox2.Text = "whatever text should appear in 2nd text box" End If End Sub
This should work. Try it
Umm... I think you should maintain a database of 'suggests' for showing them in the 2nd TextBox
As @bhi said, enable the autopostback property for the 1st textbox and do this-
This sql is for the 'suggests'. If you need some other field, just modify your sql statement.
Bind the result of this query to your multi-line 2nd textbox.
You can do this in AJAX too.
As @bhi said, enable the autopostback property for the 1st textbox and do this-
asp.net Syntax (Toggle Plain Text)
"Select * from <table> where <field> like" & me.textbox1.text & "%"
This sql is for the 'suggests'. If you need some other field, just modify your sql statement.
Bind the result of this query to your multi-line 2nd textbox.
You can do this in AJAX too.
Last edited by tuse; Jul 27th, 2008 at 7:04 am. Reason: Typo
My blog on .NET- http://dotnet.tekyt.info
![]() |
Similar Threads
- Abnormal Behaviour of Vertical ScrollBar (VB.NET)
- Input from textbox!! (VB.NET)
- [B]DropDownList, TextBox to GridView.....[/B] (ASP.NET)
- How can i add textbox values to listbox values.... (PHP)
- Link textbox value to verbiage in Word. (Visual Basic 4 / 5 / 6)
- Unwanted data injected into datagrid textbox (ASP.NET)
- Detect USB Barcode readers and capture input (Visual Basic 4 / 5 / 6)
- Timer Question (Visual Basic 4 / 5 / 6)
- Linksdot.com (Website Reviews)
Other Threads in the ASP.NET Forum
- Previous Thread: How to send email to site Admin when a new user registers?
- Next Thread: Versioning ASP.Net Website
| Thread Tools | Search this Thread |
.net 2.0 3.5 ajax alltypeofvideos appliances application asp asp.net beginner box browser businesslogiclayer button c# cac checkbox child class compatible content contenttype control countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownmenu dynamic dynamically edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv form gridview gudi iis image javascript list listbox menu mouse mssql nameisnotdeclared news novell numerical opera order parent problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security select serializesmo.table sessionvariables silverlight smoobjects software sql sql-server ssl tracking treeview typeof validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming wizard xsl





