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

Select option in website?

hi
can anybody help me on <select> option in website
I have multiple option bar with multiple choices i want when i select one choice in one bar it show only related choices on another option bar. all other choices must be hidden
thanks...


Expand|Select|Wrap|Line Numbers
  1.  
  2. <html>
  3. <head>
  4. <title>options</title>
  5.  
  6. </head>
  7. <body>
  8.  
  9. <select>
  10. <option selected="selected" value="1">Make A Choice</option>
  11. <option value="2">Diploma</option>
  12. <option value="2">UG</option>
  13. <option value="2">PG</option>
  14. </select>
  15.  
  16. <select>
  17.  
  18. <option selected="selected" value="1">Make A Choice</option>
  19. <option value="2">BCA</option>
  20. <option value="2">MBA</option>
  21. <option value="2">MSC</option>
  22. <option value="2">BBA</option>
  23. <option value="2">BSC</option>
  24. <option value="2">ENGEENERING</option>
  25. <option value="2">MBBS</option>
  26. </select>
  27.  
  28.  
  29. </body>
  30. </html>
  31.  
  32.  
I want when i select UG from first option only related option like BCA,BBA,BSc only displayed on second option not all the option. and when i select PG only MBA.MSc and so on
Apr 5 '11 #1
2 2280
hey saurabh,

unfortuneatly the only way that i can think of how you can do what you have said is via using some form of dynamic language such as javascript, php, or coldfusion.

maybe you would yield more results if you tried posting this in the javascript / ajax / dhtml section of the forums.

good luck mate
May 11 '11 #2
This can be achieved by using JavaScript.

For example just give a function along with the select in first section like

Expand|Select|Wrap|Line Numbers
  1. <select name="optionone" onClick="checkoptiontwo()">
Write the JS like this

Expand|Select|Wrap|Line Numbers
  1.  
  2. function checkoptiontwo()
  3. {
  4. if(document.getElementById("optionone").value==2)
  5. {
  6. document.getElementById("mbbs").disabled=true;
  7. }
  8. }
  9.  
Don't forget to give each option different names(eg: name="mbbs") like bca,mba,etc and also different values. This is not the exact code. But I think you will get an idea.
May 11 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Michael Hoffmann | last post by:
Hello, As you might guess I am completely new to this language. Maybe I get some help here. I try to execute a user defined funciton from a select option in a document to read a file into an...
3
by: J. Muenchbourg | last post by:
I have an ASP admin script where I'm adding records, and I have a category that already has set name values hard-coded into a selct option pulldown, but if the user wants to create a new category...
4
by: Jeff Anderson | last post by:
Is there a style for a select option's "selected" color? For example: <HTML> <BODY> <FORM NAME="form1"> <SELECT NAME="mySelect" SIZE="7" style="background-color:red;"> <OPTION>Test 1...
4
by: Old Lady | last post by:
Hi, I need help! I have a SELECT/OPTION list. My goal is to have a TEXT input field in a form that is normally disabled, but it should become enabled when the user select one predefined OPTION....
11
by: Stefan Finzel | last post by:
Hi trying to remove one or all elements of select options fails for Pocket Internet Explorer. Is there a way to do this? if is_PIE { // this does not work on Pocket IE while (opt.length) {...
2
by: shagy | last post by:
Hi, I'm having a problem with a <select><option> which has white space in values... When I post the data I only get the first word (up to the white space). "Testing white space" becomes...
1
by: kirke | last post by:
I want to load textarea's value in drop-down box. In first page, such form is existed. <form name="form1" method="post" action="next.php"> <textarea name="dayList" Id = "dayList" cols=20...
1
by: aamirghanchi | last post by:
I guess, the visibility and display styles of an OPTION in a SELECT list cannot be changed through javascript. I wanted to make some options unavailable depending on a situation eg. <select>...
3
by: pravinnweb | last post by:
Hi i have select option in my page which works fine in firefox in which i mention specific width for select option when i clicked select list the option lengths are large the option area is expanded...
7
by: fsalvador | last post by:
Hi, I am trying to figure it out how to to hide in onmouseout the select options of a form. Below is the code I got so far. It isn't working. Please help. Thanks <!DOCTYPE HTML PUBLIC...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.