b_suneetha Posted March 6, 2007 Share Posted March 6, 2007 hi guys,,,,i am new 2 thz javascript,,,, i have 2 doubts plz clarify them , itz urgent----there are 2 combo boxesone for CATEGORY and another for SUB CATEGORYi need the javascript code in which if i select a category all the corresponding sub categories should be displayed in the subcategory combo box from the database Link to comment Share on other sites More sharing options...
chadmichael Posted March 6, 2007 Share Posted March 6, 2007 hi guys,,,,i am new 2 thz javascript,,,, i have 2 doubts plz clarify them , itz urgent----there are 2 combo boxesone for CATEGORY and another for SUB CATEGORYi need the javascript code in which if i select a category all the corresponding sub categories should be displayed in the subcategory combo box from the databaseThe java script would need the data from the backend in order to do this. You just need to put the data into Javascript arrays, or objects, then make a function that rewrites the DOM objects of the second select box when the first is changed. There are on change events for the boxes that you can register your function with. Link to comment Share on other sites More sharing options...
b_suneetha Posted March 6, 2007 Author Share Posted March 6, 2007 i am sorry as i am new to thz i cant understand,,,plz xplain me in detail Link to comment Share on other sites More sharing options...
pulpfiction Posted March 6, 2007 Share Posted March 6, 2007 Javascript is a client side scripting language, so inorder to connect to database you will need a server scripting language [ASP, PHP....]. so one way to handle this is to get the data from DB and store it in javascript array and then populate dropdownlist using that array.... Link to comment Share on other sites More sharing options...
pulpfiction Posted March 6, 2007 Share Posted March 6, 2007 This might help.....http://javascript.internet.com/navigation/...opdown-box.html Link to comment Share on other sites More sharing options...
chadmichael Posted March 6, 2007 Share Posted March 6, 2007 i am sorry as i am new to thz i cant understand,,,plz xplain me in detailI don't mean to be impolite, but you are asking about fairly non-trivial tasks. You probably need to read a book, or something. I highly recommend the Oreilly Javascript book by David Flanagan. Its a big book, but you wouldn't have to read all of it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now