Jump to content

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


rajmohan

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
Link to comment
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.