954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

HTML option lists

Hi friends,

I have a question regarding the option list in HTML pages....

i have 2 items (class, subclass) each of which have some options and hence i created the drop down lists for the 2 items which when selected by user will go the action page and search for those items in my MySQL db.

Each option of my 1st item (class) has its own 2nd item(subclass). So what i want now is, once the user selects the first item from the list immediately the second item list should only display the respective sub-class items of the selected class item.

I would be really thankful if some one helps me with this.

Thanks in advance.

Cheers,
Aravind

aru211285
Newbie Poster
22 posts since Jun 2009
Reputation Points: 10
Solved Threads: 0
 

Where is your effort?
Post here, what ever you did so far.

urtrivedi
Nearly a Posting Virtuoso
1,306 posts since Dec 2008
Reputation Points: 257
Solved Threads: 270
 

the google search
There are many scripts to do just that, there are javascripts to do it clientside if the choices are limited in number
ajax scripts to pull the alternates from a DB table for more complicated data
straight html that refresh the page onchange and _GET a modified page
the one to choose depends on the type of page you are using, and the complexity of the information involved

re: search link; love that animation

almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
 

thnks alot dude.....i got it.....

aru211285
Newbie Poster
22 posts since Jun 2009
Reputation Points: 10
Solved Threads: 0
 

Select classxyz/option>

I need the option select class to be default and appear always in the drop down list so i gave it but when i choose a different class (x or y or z) and again refresh the page the drop down list is not changing to "Select class" as its default value and only if i close the browser and open again it works and even in that case the options of "Select class" are not displayed in my second drop down list as default(i used dynamic select box).

Thanks in advance.

cheers,
Aravind

aru211285
Newbie Poster
22 posts since Jun 2009
Reputation Points: 10
Solved Threads: 0
 
<option selected='selected' value=''> Select class</option>
<select name="class" id="or" onchange="populate(other dropdown)"><!-- you cannot repopulate "this" -->
<option selected='selected'value=''>Select class</option>
<option value="x">x</option>
<option value="y">y</option>
<option value="z">z/option>
</select>


In your code, the selected option fails, 'yes' is not a valid entry

the code highlighting is given by wrapping the code in [code=html] code here [/code] tags

almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
 

HI almostbob,

Thanks for the reply. but for some reason this code doesn't work. It only works if i keep the the populate option as "this" and doesn't really give what i expected (to have the first option always appear in the list everytime i refresh the browser).

Cheers,
Aravind

aru211285
Newbie Poster
22 posts since Jun 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: