Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Sorting

Status
Not open for further replies.

greyone

Programmer
Dec 14, 2000
200
CA
i have a selsct box with values as follows
Now i want to sort values in this select box on click of a button dynamically in such a way that i see the sorted values in the select box instantly. Is there a wa y to do this. Please help

i have also to written the following function :


function sortByCode()
{
var selCodeArray= new Array()
for(i=0;i<document.form0.SelCurrency.length;i++)
{
var selValues=document.form0.SelCurrency.options.value
var splitValue= selValues.split(&quot;-&quot;) , selCode=splitValue[0]
selCodeArray=selCode
}
var srtSelCode=selCodeArray.sort()
}
.
.
.
.



<select size=&quot;15&quot; name=&quot;SelCurrency&quot;>
<option value=&quot;CDN selected>CDN </option>
<option value=&quot;BDT&quot;>BDT</option>
<option value=&quot;BGL&quot;>BGL</option>
<option value=&quot;PJK&quot;>PJK </option></select>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top