Link to home
Start Free TrialLog in
Avatar of lulu50
lulu50Flag for United States of America

asked on

Sort my list

Hi,

How can I sort in alphabetic order my list in my dropdown.


Thanks,
lulu


function RemoveDepartment() {

	var selectedDepartments = $("#SelectDepartmentImpacted option:selected");
	
	$.each(selectedDepartments, function(index, value) {
		$('#DispDepartmentBox').prepend(value);
	
	});
	
                   //Here I need to sort my list

	$("#DispDepartmentBox").sortable({    axis: "y"});
                    //$( "#DispDepartmentBox" ).sortable();

	$("#SelectDepartmentImpacted option:selected").remove();
	
}

Open in new window

Avatar of Bob Bender
Bob Bender
Flag of United States of America image

Looks like, feels like, IT'S jQUERY!

Here is a link.  Haven't tested it, but I heard of this guy before....

http://sebastienayotte.wordpress.com/2009/08/04/sorting-drop-down-list-with-jquery/


Hope it helps

Bob
ASKER CERTIFIED SOLUTION
Avatar of Md Shah
Md Shah
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lulu50

ASKER

Md Shah,

Thank you I got to work!!!!

I have another problem with Jquery can you please, help me with my next question.

It's different than this one, so I have to open a new question.


Thank you Md Shah again.
Avatar of lulu50

ASKER

Thanks,

If it's Javascript/Jquery. I would love to... Shoot it, I am waiting... :)

Anyways, thanks for the Grade.