Jump to content

regarding the drop-down boxes


b_suneetha

Recommended Posts

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

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
The 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

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

i am sorry as i am new to thz i cant understand,,,plz xplain me in detail
I 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...