Jump to content


Photo

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


  • Please log in to reply
3 replies to this topic

#1 rajmohan

rajmohan
  • Members
  • PipPipPip
  • Advanced Member
  • 169 posts

Posted 01 September 2006 - 12:31 PM

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

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 01 September 2006 - 12:43 PM

Use javascript for this. There are few scripts like this over at dynamicdrive.com

#3 rajmohan

rajmohan
  • Members
  • PipPipPip
  • Advanced Member
  • 169 posts

Posted 01 September 2006 - 12:49 PM

i cannot find over there is there any way to solve this problem

#4 radalin

radalin
  • Members
  • PipPipPip
  • Advanced Member
  • 179 posts

Posted 01 September 2006 - 02:00 PM

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

<select id="sub_cat" name="sub_cat">
<option value="option1">option1</option>
<option value="option2">option2</option>
<option value="option3">option3</option>
</Select>

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
Roy Simkes
Yet Another Parkyeri Developer




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users