473,698 Members | 2,521 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2171
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.publi c.scripting.jsc ript

--

Regards

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

Keeping it FREE!
"Micromanag ed" <no*****@nospam .org> wrote in message
news:ea******** ******@TK2MSFTN GP09.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.ServerV ariables("SCRIP T_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("b tnClose") <> "" Then ' Close btn.
' Close.
Call ClosePg()
Elseif Request.Form("b tnSave") <> "" Then ' Save btn.
' Set var.
Call SetVar("frompos t")

' Save rec.
Call SaveRec()
Elseif Request.Form("b tnNew") <> "" Then ' New btn from this pg.
' Set var.
Call SetVar("new")
Elseif Request.Form("b tnDel") <> "" Then ' Del btn.
' Set var.
Call SetVar("frompos t")

' Del rec.
Call DelRec()

' Set var.
Call SetVar("new")
Elseif Request.QuerySt ring("CustID") <> "" Then ' CustID from Many pg.
' Set var.
Call SetVar("fromdb" )
Elseif Request.QuerySt ring("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
5675
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 code for the command button might be DoCmd.OpenForm "frmViewQueries", acFormDS So, frmViewQueries actually provides a datasheet view of qryQuery1. Now, what if later on I want to open qryQuery2 in the same
12
2360
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 drop down menus (ex. they may select Male, New York, Manager) and those criteria will be used to run a query (ie Query by Form). I can do this with text boxes but when I tried to use combo boxes no records were returned in the query. Any idea what...
5
2040
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 to hold patient information for research purposes. What I'm trying to do is create a form-based query system that will be easier (and less dangerous) for my future users to use to search the patient information. Let me outline the specifics,...
31
2938
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 the user has to find his record to add or modify existing data. Originally, I built the form based on a query with an input criteria for the last name and first name. The Last_Name critera is Like &"*" so that partial names will work. The...
2
5733
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 icluding the selected date or all records on or after the selected date The user selects either "=", >=" or "<=" from a combo box and then a date from another combobox. The combination of thse two choices is then set in an unbound textbox so...
5
2251
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 into each query individually and update the criteria to reflect the month I want to analyse by, is there an easy way to change the query criteria once? I have tried doing this by linking to a form with a combo box getting values from a table with...
1
4281
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 another main and sub form. The requery on the sub form and refresh comands on the main form do not work when the form is first displayed and when the selection criteria is changed. Should I be doing a refresh and then repaint of the sub form. ...
7
4010
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 combination of the combo boxes, some might not be selected etc etc. ie they may want to select the area and ward to show on the report but not the case officer or the property type
2
2580
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 want to perfom a query and based on what has been selected from the drop down boxes use this information as the criteria. If a user has only selected a supplier name then the query should return all products from that supplier, but if a user selects...
0
8611
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7741
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.