Ver Mensaje Individual
  #9 (permalink)  
Antiguo 14/05/2010, 01:12
quimfv
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Sabadell
Mensajes: 4.897
Antigüedad: 16 años, 11 meses
Puntos: 574
Respuesta: Texto y Input

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
  2. <bgsound src="../Sonidos/Speech Off.wav" loop="l" balance="b" volume="v"></bgsound>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  4. <script language="JavaScript" type="text/JavaScript">
  5. function amaga(id,num){
  6. if(num=="1"){
  7. //Primer nombres
  8.     document.getElementById(id+"1").style.display="none";
  9.     document.getElementById(id+"2").style.display="";
  10.     document.getElementById(id).value=document.getElementById(id+"0").innerHTML;
  11. }else{
  12. //primer Nombre
  13.     document.getElementById(id+"2").style.display="none";
  14.     document.getElementById(id+"1").style.display="";
  15.     document.getElementById(id+"0").innerHTML=document.getElementById(id).value;
  16. }
  17. }
  18.  
  19. </head>
  20. <body style="background-color: transparent;">
  21. <div align="center">
  22.   <form method="GET" name="checkForm" action="">
  23.     <table width="668" height="115" border="0" cellpadding="0" cellspacing="1">
  24.       <tr>
  25.         <td width="170"><div align="left"><font face="Monotype Corsiva" size="+2">Nombre</font></div></td>
  26.         <td align="left"><font face='Monotype Corsiva' size='+1'>
  27.           <table width="100%" border="0" cellspacing="0" cellpadding="0">
  28.             <tr id='nombre1'>
  29.               <td><span onClick="amaga('nombre',1)" id="nombre0">Hallking Darkking</span></td>
  30.             <tr id='nombre2' style='display:none'>
  31.               <td><input type="text" value="Hallking Darkking" onBlur="amaga('nombre',2)" id="nombre" name="nombre" ></td>
  32.             </tr>
  33.           </table>
  34.           </font></td>
  35.       </tr>
  36.       <tr>
  37.         <td><div align="left"><font face="Monotype Corsiva" size="+2">Apellido</font></div></td>
  38.         <td align="left"><font face='Monotype Corsiva' size='+1'>
  39.           <table width="491" border="0">
  40.             <tr id='apellido1'>
  41.               <td colspan="2"> <span onClick="amaga('apellido',1)" id="apellido0">Quesada Medina</span> </td>
  42.             </tr>
  43.             <tr id='apellido2' style='display:none'>
  44.               <td><input type="text" value="Quesada Medina" onBlur="amaga('apellido',2)"  id="apellido" name="apellido"/></td>
  45.             </tr>
  46.           </table>
  47.           </font> </td>
  48.       </tr>
  49.     </table>
  50.   </form>
  51. </div>
  52. </body>
  53. </html>

Hasta ahí puedo leer...

En el mail anterior te dige que no tenias porque tocar el script y lo primero que haces es duplicarlo!!!

Te aconsejo que antes de intentar hacer lo que estas intentando leas algo sobre html, que es un id, para que sirve...

Luego intenta entender lo que he hecho, ahora te he dado un ejemplo con dos campos.... solo tienes que hacer lo mismo con el retos de campos..... pero claro no solo copy/paste!!!

Quim