Ver Mensaje Individual
  #5 (permalink)  
Antiguo 11/04/2011, 15:19
Avatar de IsaBelM
IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 16 años, 8 meses
Puntos: 1012
Respuesta: No funciona replace en textbox

Cita:
Iniciado por hunabku Ver Mensaje
asi tal cual como lo tengo funciona con una paguina html pero con una paguina asp.net con controles Net no es por eso mi pregunta inicial
puede que funcione 1 vez entre 1 millón
Cita:
function quitaacentos(origen, destino) {
var text = document.getElementById(origen).value.toLowerCase( );
text = text.replace(/[áàäâå]/g, 'a');
text = text.replace(/[éèëê]/g, 'e');
text = text.replace(/[íìïî]/g, 'i');
text = text.replace(/[óòöô]/g, 'o');
text = text.replace(/[úùüû]/g, 'u');
text = text.replace(/[ýÿ]/g, 'y');
text = text.replace(/[ñ]/g, 'n');
text = text.replace(/[ç]/g, 'c');
text = text.replace(/['"]/g, '');
text = text.replace(/[^a-zA-Z0-9-]/g, ' ');
text = text.replace(/\s+/g, '_');
text = text.replace(/(_)$/g, '');
text = text.replace(/^(_)/g, '');
document.getElementById(destino).value = text;

return false;

}


<asp:TextBox ID="TextBox3" onChange="return quitaacentos(this.value,this.value)" runat="server"></asp:TextBox>
como te dice zerokilled, el segundo valor que le pasas a la función, es el valor del control

pd: .net no modifica el html resultante