By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,951 Members | 1,591 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,951 IT Pros & Developers. It's quick & easy.

3 drop down boxes

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a

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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.