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

3 drop down boxes

I have 3 drop down boxes on the same page. Each one is being populated
by a database. One is called Location, One is called Device and the
other one is called Job Title. When the user selects something from one
of the drop down boxes I would like it so it automatically calls the
phonelist.asp and passes the variable. What is the best way to do it so
I have 3 seperate drop-down boxes that just send their variables.
Should I do one form that includes all boxes or one form for each
drop-down box? How do I grab the variable from the drop-down box?

Oct 31 '05 #1
5 2071
MasterChief wrote:
I have 3 drop down boxes on the same page. Each one is being populated
by a database. One is called Location, One is called Device and the
other one is called Job Title. When the user selects something from
one of the drop down boxes I would like it so it automatically calls
the phonelist.asp and passes the variable. What is the best way to do
it so I have 3 seperate drop-down boxes that just send their
variables. Should I do one form that includes all boxes or one form
for each drop-down box? How do I grab the variable from the drop-down
box?

http://www.aspfaq.com/show.asp?id=2270
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Oct 31 '05 #2
Sorry I probably didn't explain myself very well. I don't really want
the drop-down boxes to be dependant on each other. I have Three boxes
named Location, Device and Job Title. When the user choses something
from say the Location list I want onChange to call the phonelist.asp
and just send the Location variable that I chose. If the user chooses
something from the Device list I want it to call phonelist.asp and only
send the Device that the user chose. I just don't understand the best
way to implement it and also how to have phonelist check against the
Device sent if Device is sent or Location if Location is sent.

Nov 1 '05 #3
MasterChief wrote:
Sorry I probably didn't explain myself very well. I don't really want
the drop-down boxes to be dependant on each other. I have Three boxes
named Location, Device and Job Title. When the user choses something
from say the Location list I want onChange to call the phonelist.asp
and just send the Location variable that I chose. If the user chooses
something from the Device list I want it to call phonelist.asp and
only send the Device that the user chose. I just don't understand the
best way to implement it and also how to have phonelist check against
the Device sent if Device is sent or Location if Location is sent..


You have to post to a page to enable this to happen. If you don't want to
submit your page every time the dropdown selection changes, you can use
XMLHTTP to submit to a server-side page from client-side code. Do a google
for that term and followup in a client-side scripting newsgroup such as
..scripting.jscript
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Nov 1 '05 #4

MasterChief wrote:
Sorry I probably didn't explain myself very well. I don't really want
the drop-down boxes to be dependant on each other. I have Three boxes
named Location, Device and Job Title. When the user choses something
from say the Location list I want onChange to call the phonelist.asp
and just send the Location variable that I chose. If the user chooses
something from the Device list I want it to call phonelist.asp and only
send the Device that the user chose. I just don't understand the best
way to implement it and also how to have phonelist check against the
Device sent if Device is sent or Location if Location is sent.


This is really a client side issue.

Does it matter if the selection is in the URL, or do you require a post
to your page? If it can be in the URL, just call a function such as

function dochange( element, page){
document.location.href=page + "?var=" + element.value;
}

and on the select control do an onchange:

<select onchange="dochange(this, 'mypage.asp')">
<option>....
</select>

So what you'll do is pass the page that you want to go to as the 2nd
parameter.

Nov 1 '05 #5
Here's a little something I put together that may hopefully give you
some ideas about how to construct a SQL statement with a variable number
of criteria:

Classic ASP Design Tips - Search Criteria on Multiple Fields
http://www.bullschmidt.com/devtip-searchcriteria.asp

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips

<<
Sorry I probably didn't explain myself very well. I don't really want
the drop-down boxes to be dependant on each other. I have Three boxes
named Location, Device and Job Title. When the user choses something
from say the Location list I want onChange to call the phonelist.asp
and just send the Location variable that I chose. If the user chooses
something from the Device list I want it to call phonelist.asp and only
send the Device that the user chose. I just don't understand the best
way to implement it and also how to have phonelist check against the
Device sent if Device is sent or Location if Location is sent.


*** Sent via Developersdex http://www.developersdex.com ***
Nov 2 '05 #6

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

Similar topics

6
by: PT | last post by:
I got a form with many text boxes, checkboxes and 3 drop downs. From that 3, 2 are dependant. I can choose one drop down, and the next drop down should display the dependant values of the first...
0
by: Leigh | last post by:
I am building a data entry application using Java servlets. I had hoped to use drop down boxes to provide the user with data entry selections pulled from a database, but am now questioning, given...
4
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by...
2
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
5
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1);...
7
by: callawayglfr | last post by:
I am building a database in access where I have a drop down box that relates to a text box, that part I have working but when someone selects information from the first drop down I need it to limit...
3
by: amcoldspy | last post by:
Hi, am trying to create dynamic drop down boxes.. there are 3 drop down boxes. The second drop down box elements are to be update based on the selection made in the first drop down box...
10
by: kashhere | last post by:
hi all, i had two drop down boxes on the selection of one item in the first drop down box the related items should be changed in the second one can any one please suggest me towards the solution...
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: 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?
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
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,...

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.