Ver Mensaje Individual
  #8 (permalink)  
Antiguo 23/06/2009, 19:28
VASS
 
Fecha de Ingreso: marzo-2009
Mensajes: 1
Antigüedad: 15 años, 11 meses
Puntos: 0
De acuerdo Respuesta: Transformar de Input type a Select cuando se pinche.

Este Foro es Genial....

Este post es un Poco Viejo, peor = Me salvo

Aca una Update a la Funcion para cambio de Text / Select


function CreaSelect(valor, id_){
var obj = document.createElement('select');
obj.id = id_;
obj.onchange = function(){CreaText(this.options[this.selectedIndex].text, this.id);alert(this.value)}
obj.onblur = function(){CreaText(this.options[this.selectedIndex].text, this.id);alert(this.value)}

var opt;
for(m=0; m<opc.length;m++){
obj.options[m]=(valor == opc[m])?new Option(opc[m],m,'defauldSelected'):new Option(opc[m],m);
}

document.body.replaceChild(obj,document.getElement ById(id_));
}

function CreaText(valor, id_){
var obj = document.createElement('input');
obj.type = 'text';
obj.id = id_;
obj.value = valor;
obj.onclick = function(){CreaSelect(this.value, this.id)}
document.body.replaceChild(obj,document.getElement ById(id_));
}

Solo la acorte un poco, pero hace lo mismo


Eso y Gracias de Nuevo