473,385 Members | 1,564 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,385 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 2157
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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?
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...

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.