Ver Mensaje Individual
  #3 (permalink)  
Antiguo 26/05/2007, 15:01
Avatar de eeyore
eeyore
 
Fecha de Ingreso: mayo-2006
Mensajes: 53
Antigüedad: 18 años
Puntos: 0
Pregunta Re: Detectar input text

Gracias por la ayuda, dejame checarlo, de momento esto es lo que tengo:

Código PHP:
<html>
<
head>
<
title>Teclado Prueba</title>
  
<
style type="text/css">
<!--
.
Estilo1 {
    
font-size10px;
    
font-weightbold;
    
color#666666;
}
-->
</
style>

<
script>
texto="";

function 
escribe(letra){
    
texto=document.getElementById("campo1").value;
    if(
letra=="spr"){
        
numeroLetras=texto.length-1
        texto
=texto.substring(0,numeroLetras);
    }else{
        
texto=texto+letra;
    }
    
document.getElementById("campo1").value=texto;
}
</script>

</head>

<body style="font:normal 10px/15px verdana">
<form name="form1" method="post" action="tecladoMemo2.asp">
<table width="659" border="0" align="center" cellpadding="2" cellspacing="2">
    <tr>
        <td width="645">
            <div align="center"><span class="Estilo1"> Campo1:&nbsp;
            <input type="text" name="campo1" id="campo1">
            Campo2:&nbsp;
            <input type="text" name="campo2">
            Campo3:&nbsp;
            <input type="text" name="campo3">
            </span>
          </div></td>
    </tr>
</table>
<BR>
<table border="0" align="center" cellpadding="2" cellspacing="2">
  <tr>
    <td><input type="button" value="0" onClick=escribe('0')></td>
    <td><input type="button" value="1" onClick="escribe('1')"></td>
    <td><input type="button" value="2" onClick=escribe('2')></td>
    <td><input type="button" value="3" onClick=escribe('3')></td>
    <td><input type="button" value="4" onClick=escribe('4')></td>
    <td><input type="button" value="5" onClick=escribe('5')></td>
    <td><input type="button" value="6" onClick=escribe('6')></td>
    <td><input type="button" value="7" onClick=escribe('7')></td>
    <td><input type="button" value="8" onClick=escribe('8')></td>
    <td><input type="button" value="9" onClick=escribe('9')></td>
  </tr>
  <tr>
    <td><input type="button" value="Q" onClick=escribe('Q')></td>
    <td><input type="button" value="W" onClick="escribe('W')"></td>
    <td><input type="button" value="E" onClick=escribe('E')></td>
    <td><input type="button" value="R" onClick=escribe('R')></td>
    <td><input type="button" value="T" onClick=escribe('T')></td>
    <td><input type="button" value="Y" onClick=escribe('Y')></td>
    <td><input type="button" value="U" onClick=escribe('U')></td>
    <td><input type="button" value="I" onClick=escribe('I')></td>
    <td><input type="button" value="O" onClick=escribe('O')></td>
    <td><input type="button" value="P" onClick=escribe('P')></td>
  </tr>
  <tr>
    <td><input type="button" value="A" onClick=escribe('A')></td>
    <td><input type="button" value="S" onClick=escribe('S')></td>
    <td><input type="button" value="D" onClick=escribe('D')></td>
    <td><input type="button" value="F" onClick=escribe('F')></td>
    <td><input type="button" value="G" onClick=escribe('G')></td>
    <td><input type="button" value="H" onClick=escribe('H')></td>
    <td><input type="button" value="J" onClick=escribe('J')></td>
    <td><input type="button" value="K" onClick=escribe('K')></td>
    <td><input type="button" value="L" onClick=escribe('L')></td>
    <td><input type="button" value="Ñ" onClick=escribe('Ñ')></td>
  </tr>
  <tr>
      <td>&nbsp;</td>
    <td><input type="button" value="Z" onClick=escribe('Z')></td>
    <td><input type="button" value="X" onClick=escribe('X')></td>
    <td><input type="button" value="C" onClick=escribe('C')></td>
    <td><input type="button" value="V" onClick=escribe('V')></td>
    <td><input type="button" value="B" onClick=escribe('B')></td>
    <td><input type="button" value="N" onClick=escribe('N')></td>
    <td><input type="button" value="M" onClick=escribe('M')></td>
    <td colspan="2" valign="middle" align="center"><input type="button" value="BORRAR" onClick=escribe('spr')></td>
  </tr>
  <tr>
      <td colspan="10">&nbsp;</td>
  </tr>
  <tr>
      <td colspan="10" valign="middle" align="center"><input type="button" value="ESPACIO" onClick=escribe('&#160')></td>
  </tr>
</table>
<BR>
<table width="790" border="0" align="center" cellpadding="2" cellspacing="2">
    <tr>
        <td width="468">&nbsp;</td>
        <td width="308">
            <table border="0" align="center" cellpadding="2" cellspacing="2">
              <tr>
                <td colspan="10" valign="middle" align="center">
                    <input type="submit" value="CONTINUAR">
                </td>
              </tr>
            </table>
        </td>
    </tr>
</table>

</form>
</body>
</html> 
Y este el archivo que recibe el form.

Código PHP:
<html>
<
head>
<
title>Teclado Prueba</title>


</
head>
<%
texto1=request.Form("campo1")
texto2=request.Form("campo2")
texto3=request.Form("campo3")
%>

<
body style="font:normal 10px/15px verdana">
<
table width="659" border="0" align="center" cellpadding="2" cellspacing="2">
    <
tr>
        <
td width="645">
            
Campo1:&nbsp;
            <
input type="text" name="campo1" value="<%=request.Form("campo1")%>">
        </
td>
    </
tr>
    <
tr>
        <
td width="645">
            
Campo2:&nbsp;
            <
input type="text" name="campo2" value="<%=request.Form("campo2")%>"></td>
    </
tr>
    <
tr>
        <
td width="645">
            
Campo3:&nbsp;
            <
input type="text" name="campo3" value="<%=request.Form("campo3")%>">
        </
td>
    </
tr>
</
table>
</
body>
</
html
El punto es que como va a ser por medio de una pantalla touch screen necesito que dependiendo del campo que se selecciono mande a escribir a ese campo, hasta ahora solo me escribe en el campo 1.