Login   Register  
PHP Classes
elePHPant
Icontem

Moving List: Create select inputs and move items between them

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2004-03-16 (10 years ago) RSS 2.0 feedStarStarStarStar 60%Total: 2,213 All time: 1,657 This week: 1,553Up
Version License Categories  
cmovinglist 1.0GNU General Public Lice...Content management
Description Author  

This class is meant to assist in the creation of forms with pairs of multiple select inputs with buttons to move options between each of the select inputs.

This is useful to manage lists of values that are made of a limited set of known options.

The class does not generate the form inputs. It just generates the necessary Javascript code to associate to onclick events of form buttons that remove options from one select input and add them to the other.

Innovation Award  
PHP Programming Innovation award nominee
March 2004
Number 4


Prize: One copy of the Zend Studio by Zend
Some times Web developers have solve the problem of building a list made of items that exist on another list.

For instance, if you want to classify an article for publication that may belong to multiple categories, once you associate the article to a given category, the category will move from the list of possible categories to the list of categories already associated with the article. If you want to remove the association of an article with a category, the opposite list movement needs to be executed.

The problem of implementing movements of items between two lists in a Web application is that the Web controls provided by common HTML forms do not provide an easy way to implement this kind of dynamic user interface manipulation.

The solution provided by this class is to generate Javascript code that can move items between two lists defined with multiple select inputs. The generated Javascript code can be associated to the onclick events of additional control buttons.

Although this solution could be implemented without the need to resort to Javascript, it would require additional form submissions to update the state of the lists, thus making the Web forms less usable.

Manuel Lemos
Picture of Setec Astronomy
Name: Setec Astronomy <contact>
Classes: 20 packages by
Country: Italy Italy
Age: ???
All time rank: 141 in Italy Italy
Week rank: 52 Down3 in Italy Italy Down
Innovation award
Innovation award
Nominee: 5x

  Files folder image Files  
File Role Description
Plain text file CMovingList.php Class Class file
Accessible without login Plain text file sample.php Example Sample script

 Version Control Unique User Downloads Download Rankings  
 0%Total:2,213All time:1,657
 This week:0This week:1,553Up
 User Ratings  
 
 All time
Utility:88%StarStarStarStarStar
Consistency:77%StarStarStarStar
Documentation:-
Examples:84%StarStarStarStarStar
Tests:-
Videos:-
Overall:60%StarStarStarStar
Rank:861