Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/12/2011, 06:03
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: HTML Cuadro de texto editable

Tenes que cambiar las propiedades con javascript
algo asi (le agregué algunos detalles para resaltar el estado on/off)

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6.  
  7. <style type="text/css">
  8. /*<![CDATA[*/
  9.  
  10. input#texto {
  11. color: #000;
  12. border: solid 1px #000;
  13. }
  14.  
  15. /*]]>*/
  16. <script type="text/javascript">
  17. //<![CDATA[
  18. function cambiarestado(){
  19.  
  20. var valor = document.getElementById('texto').readOnly;
  21. if (valor == false){
  22. document.getElementById('texto').readOnly = true;  
  23. document.getElementById('texto').style.border = 'solid 1px #666';
  24. document.getElementById('texto').style.color = '#666';
  25. document.getElementById('cambia').value = 'habilitar';  
  26. }else{
  27. document.getElementById('texto').readOnly = false;  
  28. document.getElementById('texto').style.border = 'solid 1px #000';
  29. document.getElementById('texto').style.color = '#000';
  30. document.getElementById('cambia').value = 'deshabilitar';  
  31. }
  32.  
  33. }
  34. //]]>
  35. </head>
  36. <form action="#">
  37. <p>
  38. <input type="text" id="texto" value="" />
  39. <input type="button" value="deshabilitar" id="cambia" onclick="cambiarestado();" /> <input type="reset" value="borrar" />
  40. </p>
  41. </form>
  42. </body>
  43. </html>

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.