Jump to content

Sorting the values in drop down menu


noureen

Recommended Posts

Hello,

 

i am stuck with the problem. I want to add names of the states in drop down menu but i want them to be selected under each category like if user  selects USA then its all states shd be shown from database.

 

can any one help me in this regard.

THx

Link to comment
Share on other sites

OK example

<select name="list1" onchange="ajaxFunction('LBox2', this.value);">

<option value='1'>Red</option>

<option value='5'>Green</option>

<option value='10'>Blue</option>

</select>

 

Now when the Item from list1 is selected the value LBox2 and the selected value is passed to the a PHP script, in the example it passes to itself, now that part echos some data back, NOW whatever is echoed is printed in the object with the ID LBox2..

 

which in the example is

 

<select name="list2" id="LBox2">

<!-- OK the ID of this list box is LBox2 as refered to above -->

</select>

 

so "<!-- OK the ID of this list box is LBox2 as refered to above -->" is replaced

 

make sense ?

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.