3 drop down boxes

M

MasterChief

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?
 
B

Bob Barrows [MVP]

MasterChief said:
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
 
M

MasterChief

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.
 
B

Bob Barrows [MVP]

MasterChief said:
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
 
L

Larry Bud

MasterChief said:
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.
 
B

Bullschmidt

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top