473,396 Members | 1,936 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,396 software developers and data experts.

OnChange Lookup ASP recordset

I have a form on a webpage that someone enters a number (SponsorID).
After then enter that SponsorID into the form, I need to somehow query
my SQL database and find the record that has the same ID as the
SponsorID entered into the form and return the SponsorName (and write
it out on the page using a <div> tag or something of the like) WITHOUT
reloading the entire page (because I will loose the other information
already input on this page).

Now, I don't necessarly have to query the database, I *could* create
an Array when the page loads, using ASP, that will contain the
SponsorIDs and the SponsorNames and then compare the SponsorIDs within
that array with the number that was entered on the form.

My problem, is that I cannot figure out how to do any of this. Any
help would be greatly appreciated.

Thanks!

Ryan
Jul 19 '05 #1
2 2016
Use an IFRAME to load only a part of the page, no need to preload all
records. You will have to use a client-side javascript to capture the change
of the recordID, and load thsi IFRAME. SOmething like

<script language=javascript>
function loadRecord()
{
recordFrame.src = 'mypage.asp?id=' + document.form.recordID.value;
}
</script>

<input type=text onblur="loadRecord()" name="recordID">
<iframe id=recordFrame src="" height=100 width=100></iframe>
--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Ryan" <we*******@moboysstate.org> wrote in message
news:e5*************************@posting.google.co m...
I have a form on a webpage that someone enters a number (SponsorID).
After then enter that SponsorID into the form, I need to somehow query
my SQL database and find the record that has the same ID as the
SponsorID entered into the form and return the SponsorName (and write
it out on the page using a <div> tag or something of the like) WITHOUT
reloading the entire page (because I will loose the other information
already input on this page).

Now, I don't necessarly have to query the database, I *could* create
an Array when the page loads, using ASP, that will contain the
SponsorIDs and the SponsorNames and then compare the SponsorIDs within
that array with the number that was entered on the form.

My problem, is that I cannot figure out how to do any of this. Any
help would be greatly appreciated.

Thanks!

Ryan

Jul 19 '05 #2
Please don't multi-post.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Ryan" <we*******@moboysstate.org> wrote in message
news:e5*************************@posting.google.co m...
I have a form on a webpage that someone enters a number (SponsorID).
After then enter that SponsorID into the form, I need to somehow query
my SQL database and find the record that has the same ID as the
SponsorID entered into the form and return the SponsorName (and write
it out on the page using a <div> tag or something of the like) WITHOUT
reloading the entire page (because I will loose the other information
already input on this page).

Now, I don't necessarly have to query the database, I *could* create
an Array when the page loads, using ASP, that will contain the
SponsorIDs and the SponsorNames and then compare the SponsorIDs within
that array with the number that was entered on the form.

My problem, is that I cannot figure out how to do any of this. Any
help would be greatly appreciated.

Thanks!

Ryan

Jul 19 '05 #3

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

Similar topics

2
by: Asit | last post by:
In JavaScripts checks for an onChange event against the value of the textbox at the time of the last onChange event. Since an onChange Event never fired after you changed the text first time ,...
3
by: dthmtlgod | last post by:
When a user changes the value in a select statement, I would like to update the recordset using a onchange event. Could someone please point me in the right direction? Would like to stay away...
3
by: jbsfe | last post by:
I have "Spilt" my database and the "lookup" and "seek" methods that previously worked, no longer do. I have learnd from reviewing the posts that the "lookup" and "Seek" methods cannot be used on...
9
by: linda | last post by:
I have a form with some combo boxes used as lookup fields: customer Name, Customer Number, Address, Phone number. I have imported the customer information form another data base. The lookup...
7
by: Peter | last post by:
Does anyone know how to trap SelectedIndexChanged event on the client side for the following control? http://www.metabuilders.com/Tools/ComboBox.aspx I have tried...
18
by: Mike Will via WebmasterKB.com | last post by:
I need some help with an onchange event for one of my select boxes on my form. I need to select a value from the box and use that value in the query that will produce results for another select...
3
by: fishctr | last post by:
Hi there, I am trying to get a zip code lookup script to work. Basically, I want the user to input a zip code and the city and state are displayed without using a button to find it. I already have...
3
by: MrDeej | last post by:
Hello! I am designing an import module in my access database for text files it looks like thisDim GammeltNavn As String Dim NyttNavn As String Dim MaskinNavn As String Dim fsoFileSearch As...
1
by: KMEscherich | last post by:
Hi there, am confused. Am wondering if you have a lookup control on the form and it populates the form with the selected Employee Name and all other pertinent data, is there a way to have 2 lookup...
7
by: kirkgilbert | last post by:
I am trying to do an onchange event in a form using a text field. The form is tied to a record set that is part of a repeated region. One the first record when I edit the data it works perfectly. ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.