Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 14700

Botão para preencher campo

$
0
0
Boas a todos,

Estou com um problema ao criar um botão para preencher um campo.
A ver se alguém me consegue explicar como posso fazer.

Tenho um local (Código postal) que será para introduzir 4 números e depois mais 3 números.
Agora aqui tenho o problema:

Tenho um botão e quero que ele pegue os 7 números e verifique se existe esse código postal para preencher dois campos sem sair da pagina do formulário.


Código (HTML):
<p><center><h3><strong>Código Postal: </strong>
<input type="Integer" name="Cp" maxlength="4" size="4"> - <input type="Integer" name="Cp2" maxlength="3" size="1">
<button type="button"  style='width: 100px' value="#botao">Automático</button></center></p><br>
<p><center><h3><strong>Morada: </strong>
   <input type="text" name="Morada"></center></p><br>
<p><center><h3><strong>Distrito: </strong>
   <input type="text" name="Distrito"></center>
<p><center><h3><strong>Concelho: </strong>
   <input type="text" name="Concelho"></center>

Viewing all articles
Browse latest Browse all 14700