473,396 Members | 2,011 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.

Form change based upon criteria selected?



Is it possible (and if so, how?) to have an asp form page that based
upon a user's selection on a field, would generate a input field b that
the user selects?

For example:

User selects "name" in a select statement which would list the possible
names to select from or if the user selects "telephone" in the same
select statement then it would list the possible telephone numbers to
select from.

Or simpler:

If user selects A then show P to select from or
if user selects B then show Z to select from.

Thanks in advance
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
3 2158
You'd need to either;

1. Use If/Then or Select Case, combined with a querystring
2. Use client side code

For the latter, you'd need to post to a client side group, such as;

microsoft.public.scripting.jscript

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"Micromanaged" <no*****@nospam.org> wrote in message
news:ea**************@TK2MSFTNGP09.phx.gbl...


Is it possible (and if so, how?) to have an asp form page that based
upon a user's selection on a field, would generate a input field b that
the user selects?

For example:

User selects "name" in a select statement which would list the possible
names to select from or if the user selects "telephone" in the same
select statement then it would list the possible telephone numbers to
select from.

Or simpler:

If user selects A then show P to select from or
if user selects B then show Z to select from.

Thanks in advance
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #2


I tried using If..Then, but I couldn't get it to work. Once I select a
value in the first field, does the fieldname receive that value as soon
as I select it, or is it still null until I hit the submit button on the
form?
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
Here's something I put together about having pages post back to
themselves that hopefully might give you some ideas.

ASP Design Tips - Post Back Page
http://www.bullschmidt.com/devtip-postbackpage.asp

Perhaps have most Web pages "post back" to themselves and then handle
further processing from there. This can often cut down on the number of
pages that need to be developed and the related back-and-forth involved
with many pages.

To make the form post back to the same page:
<form id="frmMain" name="frmMain" action="<%=
Request.ServerVariables("SCRIPT_NAME") %>" method="post">

And here are some buttons:
<% ' *** btnClose %>
<input type="submit" name="btnClose" value="Close">
<% ' *** btnSave %>
<input type="submit" name="btnSave" value="Save">
<% ' *** btnNew %>
<input type="submit" name="btnNew" value="New">
<% ' *** btnDel %>
<input type="submit" name="btnDel" value="Delete" onclick="return
confirm('Are you sure you want to delete this record?');">

To handle processing toward the top of the page:
If Request.Form("btnClose") <> "" Then ' Close btn.
' Close.
Call ClosePg()
Elseif Request.Form("btnSave") <> "" Then ' Save btn.
' Set var.
Call SetVar("frompost")

' Save rec.
Call SaveRec()
Elseif Request.Form("btnNew") <> "" Then ' New btn from this pg.
' Set var.
Call SetVar("new")
Elseif Request.Form("btnDel") <> "" Then ' Del btn.
' Set var.
Call SetVar("frompost")

' Del rec.
Call DelRec()

' Set var.
Call SetVar("new")
Elseif Request.QueryString("CustID") <> "" Then ' CustID from Many pg.
' Set var.
Call SetVar("fromdb")
Elseif Request.QueryString("CustID") = "" Then ' Add btn from MainMenu
pg.
' Set var.
Call SetVar("new")
End If

And the ClosePg(), DelRec(), SaveRec(), and SetVar() functions above are
custom functions that would still need to be developed.

Best regards,
J. Paul Schmidt, Freelance ASP Web Designer
http://www.Bullschmidt.com
ASP Designer Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #4

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

Similar topics

3
by: Marcus | last post by:
Wondering if it is possible to use one form to open different queries at different times. As an example, I may have frmViewQueries that opens up when I click a command button on frmMain. So, the...
12
by: Tom | last post by:
Hello, I have a database of employee data in access and I am trying to create a form with combo boxes for criteria (ex. gender, office, position, etc.) that let the user select criteria from...
5
by: SeanCly10 | last post by:
Hi all. I don't want to sound like a complete idiot here, but I'm somewhat limited in my coding knowledge, and I need some advice and help. I'm working on a database that will eventually be used...
31
by: DWolff | last post by:
I'm somewhat new to Access, and have no VB experience at all (except for modifying existing code where obvious). I built a data entry form that works fine. Typically, a client will call in and...
2
by: Mark Roughton | last post by:
I have a form where the users need to view records for various criteria, one of which is a date field on which they may wish to view all related data for the selected date, for all dates upto and...
5
by: EricS | last post by:
Hi, Was wondering if anyone can help. I have multiple queries in a database. The selection criteria for these queries is always a time period I want to do the analysis by. Rather than having to go...
1
by: tomlebold | last post by:
Having problems displaying query results from combo boxes on a sub form, which is on the same form that is used to select criteria. This has always worked form me when displaying query results on...
7
by: Ceebaby via AccessMonster.com | last post by:
Hi All Here's hoping someone can help me with this. I have a report based on a query where the criteria for 4 of the fields is set from an unbound form. I want the user to be able to select any...
2
by: Ru55ell | last post by:
Hi I have written a form that has 4 drop down selection boxes on it, with check boxes next to them. When a user selects something from the drop down box the check box is automatically selected. I...
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: 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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.