ternstyle - Lehigh Valley, Allentown, Bethlehem, Easton, WordPress, Lehigh Valley web design, web programming, web development, lehigh valley web hosting, content management tools, website plugins, WordPress plugins, WordPress Themes, php libraries, php classes, javascript libraries, javascript classes, jQuery plugins, web programming, free web software, free php classes, free software

  • NEW EVENT PLUGIN FOR WordPress ™!

    ternCal is the New Ultimate WordPress ™ Event System!

    Featuring repeating events, Google Calendar integration, ICAL and Outlook Support, month, week, and day views, WordPress ™ short code for listing events, a color coded legend and much much more...

    Check it out now!

HTML Select Element PHP Class

Often when creating databasing applications with front-end or back-end user interfaces it’s necessary to create HTML form select elements from database record sets or other arrays. This class offers a very easy and efficient way to compile these form elements with one command.

Download

Download HTML Select Element PHP Class

4.5

4 KB

Current Version

The current version of this software is 4.5.

Sample Code

$array = array("key1"=>"value1","key2"=>"value2");
$select_class = new selectClass();
$object = $select_class->select($array,'id','name','title','class');

The above variable $object will be an HTML form element which will print to a page like so:

<select id="id" name="name" title="title">
	<option value="value1">key1</option>
	<option value="value2">key2</option>
</select>

Features

  • Compile HTML select elements from arrays, associative arrays or multi-dimensional arrays.
  • Compile select elements with a value initially selected
  • Compile multi-select elements with multiple values initially selected
  • Use values in the specified array as the initially selected value
  • Create custom default selected values
  • Compile select elements from ranges of numbers
  • Create tiered select elements
  • Assign javascript functions to the select element’s onChange event.

Requirements

  • PHP 4.0+

Documentation

Home > Products > PHP classes > HTML Select Element PHP Class

Copyright © 2010 Ternstyle Inc. All rights reserved.
site design: ternstyle.us
Lehigh Valley Website Design