Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 9th, 2003, 06:51 AM
Authorized User
 
Join Date: Nov 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Getting data based on field selection

Hi,

I have a form and one of the fields is an id code, and each code has it's own description within a sql database, what I am trying to acheieve is that when somebody enters a code into the form field then changes the focus to the next form field I want to trigger a stored procedure to get the description from the database relevant to the code entered and display it on the page.

Getting the information is not a problem but I am not sure how I can trigger the event based on the user selecting the next form field.

Many thanks for any help
Peter

 
Old December 9th, 2003, 10:47 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You'll need to use the onChanged event of the input control, and have that fire off a form post. The form will have to post to the same page (called PostBack) so you can then use the value entered to do your look up and populate whatever you need to show the matching description.

If I may offer a better solution:
Seeing as it sounds like you have a fixed set of IDs (with matching descriptions) why not have a dropdown list of the ID, but show the descriptions instead of IDs for a more user-friendly experience?

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
selection based on conditions rajesh_css XSLT 3 October 2nd, 2008 08:06 PM
Fill DataGrid based on the selection in combobox drani C# 12 October 11th, 2007 05:41 PM
Changing combobox based on selection iamme Visual Basic 2005 Basics 0 January 31st, 2007 09:04 PM
validate zipcode based on country selection. debjanib ASP.NET 1.0 and 1.1 Professional 5 August 14th, 2006 04:35 PM
Update city field based on zip field nganb SQL Server ASP 0 April 22nd, 2004 10:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.