HighDots Forums  

Linked dropdowns

Javascript JavaScript language (comp.lang.javascript)


Discuss Linked dropdowns in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sheldonlg
 
Posts: n/a

Default Linked dropdowns - 06-02-2008 , 10:59 AM






I am still learning more of Javascript, so please bear with me.

My objective is to have a dropdown list for categories. Depending upon
what the user clicks, I want the subcategories dropdown to change
content. I am sure this has been done many times and a pointer would be
helpful. I googled, but didn't find anything (Maybe because I don't
know the right keywords to use). The back end server code is in php, so
an ASP solution is not viable.

My idea is to attach and onchange to the category dropdown. Depending
upon the value in that dropdown, I would read the contents of a file on
the server and via innerHTML change the contents of the subcategory
dropdown list. In my googling, all I seem to come up with is reading
from the user's machine. These files would be on the server, so it
really should be much easier, but I haven't found it.

I know I can do this with php, however that involves either regenerating
the page or using AJAX. I am looking to see if there is a straight
javascript solution.

BTW, if there is a better way I am totally open to suggestions.

Reply With Quote
  #2  
Old   
sheldonlg
 
Posts: n/a

Default Re: Linked dropdowns - 06-02-2008 , 04:57 PM






sheldonlg wrote:
Quote:
I am still learning more of Javascript, so please bear with me.

My objective is to have a dropdown list for categories. Depending upon
what the user clicks, I want the subcategories dropdown to change
content. I am sure this has been done many times and a pointer would be
helpful. I googled, but didn't find anything (Maybe because I don't
know the right keywords to use). The back end server code is in php, so
an ASP solution is not viable.

My idea is to attach and onchange to the category dropdown. Depending
upon the value in that dropdown, I would read the contents of a file on
the server and via innerHTML change the contents of the subcategory
dropdown list. In my googling, all I seem to come up with is reading
from the user's machine. These files would be on the server, so it
really should be much easier, but I haven't found it.

I know I can do this with php, however that involves either regenerating
the page or using AJAX. I am looking to see if there is a straight
javascript solution.

BTW, if there is a better way I am totally open to suggestions.

I did it with an AJAX technique.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.