El sitio más completo sobre programación, recursos web y herramientas online para Webmasters
Fecha: 25/11/2005

Dropdown php

Trucos php:
Crea un dropdown

Código Php


/* formDropDown - create an HTML <SELECT>
* vars: $name - the form variable NAME
* $value - the SELECTED option
* $labels - assoc. array, list of values=>labels
* returns: string, HTML (i.e. for use in echo or print statement)
*/
function formDropDown($name,$value,$labels) {
$html = "<SELECT NAME=\"$name\">\n";
$key = key($labels);
while($key != "") {
if ($key == $value) {
$selected = "SELECTED";
} else {
$selected = "";
}
$html .= "<OPTION VALUE=\"$key\" $selected>$labels[$key]\n";
next($labels);
$key = key($labels);
}
$html .= "</SELECT>\n";
return $html;
}
Dropdown php Categoría: Trucos, Php


Scripts Similares:

» Administracion php
» Administrar BD php
» Buscar item php
» Buscar php
» Buscar y reemplazar php
» Campos ocultos php
» Contador en php
» Contador php
» Crear carpetas php
» Editar pagina php

Privacidad ּ Publicidad ּ Prensa ּ Premios ּ Colaborar ּ Enlazarnos ּ Mapa del Sitio ּ Aviso legal ּ Boletín ּ Contacto
2001 - 2011 | Sitio creado y mantenido por Gabriel Marcelo Rodríguez
Hosting de alta calidad a bajo costo Neolo.com.ar