AJAX
Whilst working various OpenSource projects I have created various functions for constructing Backbase (client edition) code through a simple PHP class (still in development).
One of the most useful functions is combobox creation.
public function combobox($name, $values_array, $default=null, $size=300, $required=false){
$req_bxml = ($required)? " b:required=\"true\"" : "";
$bxml = '<b:combobox b:width="'. $size .'px" b:name="'. $name .'" b:text="'. $default .'"'. $req_bxml .'>';
foreach ($values_array as $value) {
$bxml .= '<b:combo-option b:value="'. $value['value'] .'">'. $value['name'] .'</b:combo-option>';
}
$bxml .= '</b:combobox>';
return $bxml;
}
$req_bxml = ($required)? " b:required=\"true\"" : "";
$bxml = '<b:combobox b:width="'. $size .'px" b:name="'. $name .'" b:text="'. $default .'"'. $req_bxml .'>';
foreach ($values_array as $value) {
$bxml .= '<b:combo-option b:value="'. $value['value'] .'">'. $value['name'] .'</b:combo-option>';
}
$bxml .= '</b:combobox>';
return $bxml;
}
With this code you simply pass it a name followed by an array of values. The other options allow you to define a "selected" value, then the size of the combobox and whether or not it is required. The required functionality is not yet implemented into the Backbase control so best ignore it for the time being.
pdavies | AJAX | 18 June, 9:34am
| Comment on this
Category Cloud
Link Dump Tag Cloud
Today: Wednesday, 07 January 2009
Categories
- AJAX (1) [atom | rss]
- General (1) [atom | rss]
- Joomla (2) [atom | rss]
- Linux Backups (1) [atom | rss]
- Miscellaneous (1) [atom | rss]
- MySQL (2) [atom | rss]
- PHP Programming (1) [atom | rss]
- Zend Framework (1) [atom | rss]
Main Menu
Articles
Tools
FileBrowser
![]() |
Applications |
![]() |
Computer_Forensics |
![]() |
Computer_Law |
![]() |
Cryptography_and_E-Commerce |
![]() |
Internet_Security |
![]() |
Joomla |
![]() |
Miscellaneous |
![]() |
Network_Security |
![]() |
Security_Management |
![]() |
Systems_Administration |
![]() |
Web_Development |
Blog Archives
- June 2007 (10)
Online Visitors:2
Today Visitors:10
Total Visitors:6210


