Inside Technique : Reordering Items in a Listbox
Manipulating HTML forms is one of the easier areas of cross-browser scripting. In this article, we show you how to allow users to reorder content inside of a listbox. We demonstrate both the client-side script for manipulating the listbox and a sample server script that enables you to process the changes. This technique works in Netscape Navigator 3.0 and Internet Explorer 4.0 and later. Unfortunately, this technique won't work in Internet Explorer 3.0 because IE3 does not support manipulating listbox contents .
Clicking the Submit New Order button sends the results to our server. On the server, we process the list regenerating the listbox in the new order. We will explain both the client-side scripts that provide the user interactivity and our simple server-script that processes the results. We start by explaining the client script used to generate the demonstration.
© 1997-2000 InsideDHTML.com, LLC. All rights reserved.