Jump to content

Archived

This topic is now archived and is closed to further replies.

rajmohan

(WANT HELP ) onchange listbox, get values in another listbox POSIBLE ?

Recommended Posts

Hai guy

i am having on doudt in my project i am using two list box. If i select category from listbox1 i want to display sub_category in  listbox2 without page refresh(it is posible)

i am doing that onchange i pass value to the url then i get the sub_Category throught the GET method

Help me

Share this post


Link to post
Share on other sites
Use javascript for this. There are few scripts like this over at dynamicdrive.com

Share this post


Link to post
Share on other sites
well I assume you use XMLHTTPReqeust object for getting the sub_category box.
In the url where you send the value do not send only the sub category options but all the selectbox. Instead of returning something like

option1,option2,options

return something like

[code=html]
<select id="sub_cat" name="sub_cat">
<option value="option1">option1</option>
<option value="option2">option2</option>
<option value="option3">option3</option>
</Select>
[/code]

and then all you have to is to sub_cat_location.innerHTML = ro.responseText and you are done.

If you do not use xmlhttprequest to the same but instead of assigning ro.responseText, assign the string variable you use for the listing or whatever you use

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.