Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Browsers / Internet Explorer / September 2004



Tip: Looking for answers? Try searching our database.

<no subject>

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jason Byer - 25 Sep 2004 21:48 GMT
Hello,



I was wondering if anyone can help me with a problem that I¹m having.  I¹m
building a form where the user selects an option from a drop down menu.
Then after the option is selected the form changes.  By changes I mean that
different text fields or checkboxes are shown depending on what option is
chosen in the first select tag.  Can anyone help me with this or point me in
the right direction.



Thanks!




Jason
Joe Fawcett - 26 Sep 2004 11:00 GMT
Hello,

I was wondering if anyone can help me with a problem that I'm having.  I'm
building a form where the user selects an option from a drop down menu.
Then after the option is selected the form changes.  By changes I mean that
different text fields or checkboxes are shown depending on what option is
chosen in the first select tag.  Can anyone help me with this or point me in
the right direction.

Thanks!

Jason

Start by attaching an event handler to the select box:
<select onchange="handleSelectChange(this);">...

then in your function retrieve the value currently chosen and make changes:

function handleSelectChange(Select)
{
 var oOption = Select.options[Select.selectedIndex];
 //Test
 alert(oOption.text + "\n" + oOption.value);
 switch (oOption.value)
 {
    case 1:
      //Do something
    break;
    case 2:
      //Do something else
    break;
    // More...

 }
}

Signature

Joe (MVP)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.