drop down question
This is a multi-part message in MIME format.
------=_NextPart_000_0006_01C825DF.32E14D20
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
On my page I have 3 drop downs that are populated with static data. When =
my user makes a selection in either drop down I want to show my HTML =
table associated with that drop down selection, also the data in my =
tables are all static.
For example.
if the user selects CAR - New in dropdown 1 I want to show a list of my =
new cars
if the user selects TRUCK in dropdown 2, I want to hide my CARS and show =
my TRUCK list
if the user selects BOATS - Fiberglass in dropdown 3, I want to hide (if =
shown) CARS, and TRUCKS and show my boat list.
For now all of the data is static (don't ask) so I need to do all of =
this on the client. Is there a way to do this either using JavaScript, =
Div tags, CSS, etc.
any help is apprecaited.
------=_NextPart_000_0006_01C825DF.32E14D20
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.3157" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>On my page I have 3 drop downs that are populated =
with static
data. When my user makes a selection in either drop down I want to show =
my HTML
table associated with that drop down selection, also the data in my =
tables are
all static.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>For example. </FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>if the user selects CAR - New in dropdown 1 I =
want to
show a list of my new cars</FONT></DIV>
<DIV><FONT size=3D2>if the user selects TRUCK in dropdown 2, I want to =
hide my
CARS and show my TRUCK list</FONT></DIV>
<DIV><FONT size=3D2>if the user selects BOATS - Fiberglass in dropdown =
3, I want
to hide (if shown) CARS, and TRUCKS and show my boat list.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>For now all of the data is static (don't ask) so I =
need to do
all of this on the client. Is there a way to do this either using =
JavaScript,
Div tags, CSS, etc.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>any help is apprecaited.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_0006_01C825DF.32E14D20--
Re: drop down question
"Scott" <Scott [at] community.nospam.com> wrote in message
news:%23lvIbkgJIHA.5208 [at] TK2MSFTNGP04.phx.gbl...
>On my page I have 3 drop downs that are populated with static data. When my
>user makes a selection in either drop down I want to show my HTML table
>associated with that drop down selection, also the data in my tables are
all static.
>
>For example.
>
>if the user selects CAR - New in dropdown 1 I want to show a list of my new
cars
>if the user selects TRUCK in dropdown 2, I want to hide my CARS and show my
>TRUCK list
>if the user selects BOATS - Fiberglass in dropdown 3, I want to hide (if
shown) >CARS, and TRUCKS and show my boat list.
>
>For now all of the data is static (don't ask) so I need to do all of this
on the >client. Is there a way to do this either using JavaScript, Div tags,
CSS, etc.
>
Yes.
Although I'm a bit confused by the UI design, if each choice in each
dropdown is mutually exclusive with all the other choices why have multiple
dropdowns?
Give each table of data an ID attribute; give each table a
Class="displayable" attribute. Give each option in the Select(s) a value
which is the ID of the respective table.
In a <style type="text/css"> element in the page head place this this
style:-
table.displayable {display:none}
Now on the select element(s) add the attribute
onchange="changeDisplay.call(this)"
in Javascript
var m_currentDisplayTable = null
function changeDisplay()
{
if (m_currentDisplayTable)
document.getElementById(m_currentDisplayTable).style.display =
"none"
m_currentDisplayTable = this.value
document.getElementById(m_currentDisplayTable).style.display = "block"
}
BTW, for future reference for purely clientside questions the
scripting.jscript group is a far more appropriate group.
--
Anthony Jones - MVP ASP/ASP.NET
Re: drop down question
thanks, its an odd design yeah I know, but its what the business wanted
"Anthony Jones" <Ant [at] yadayadayada.com> wrote in message
news:OECP0AhJIHA.4592 [at] TK2MSFTNGP02.phx.gbl...
>
> "Scott" <Scott [at] community.nospam.com> wrote in message
> news:%23lvIbkgJIHA.5208 [at] TK2MSFTNGP04.phx.gbl...
>>On my page I have 3 drop downs that are populated with static data. When
>>my
>>user makes a selection in either drop down I want to show my HTML table
>>associated with that drop down selection, also the data in my tables are
> all static.
>>
>>For example.
>>
>>if the user selects CAR - New in dropdown 1 I want to show a list of my
>>new
> cars
>>if the user selects TRUCK in dropdown 2, I want to hide my CARS and show
>>my
>>TRUCK list
>>if the user selects BOATS - Fiberglass in dropdown 3, I want to hide (if
> shown) >CARS, and TRUCKS and show my boat list.
>>
>>For now all of the data is static (don't ask) so I need to do all of this
> on the >client. Is there a way to do this either using JavaScript, Div
> tags,
> CSS, etc.
>>
>
> Yes.
>
> Although I'm a bit confused by the UI design, if each choice in each
> dropdown is mutually exclusive with all the other choices why have
> multiple
> dropdowns?
>
> Give each table of data an ID attribute; give each table a
> Class="displayable" attribute. Give each option in the Select(s) a value
> which is the ID of the respective table.
>
> In a <style type="text/css"> element in the page head place this this
> style:-
>
> table.displayable {display:none}
>
> Now on the select element(s) add the attribute
> onchange="changeDisplay.call(this)"
>
> in Javascript
>
> var m_currentDisplayTable = null
> function changeDisplay()
> {
> if (m_currentDisplayTable)
> document.getElementById(m_currentDisplayTable).style.display =
> "none"
>
> m_currentDisplayTable = this.value
>
> document.getElementById(m_currentDisplayTable).style.display = "block"
> }
>
> BTW, for future reference for purely clientside questions the
> scripting.jscript group is a far more appropriate group.
>
> --
> Anthony Jones - MVP ASP/ASP.NET
>
>
>