Javascript
roland999
Messages postés
32
Date d'inscription
Statut
Membre
Dernière intervention
-
roland999 Messages postés 32 Date d'inscription Statut Membre Dernière intervention -
roland999 Messages postés 32 Date d'inscription Statut Membre Dernière intervention -
bonjour,
j'ai besion d'aide. en gros voici mon probleme
o fait je veux fait ceci quand on rentre le matricule d'un individu je veux que dans l'autre champs s'affiche le noms lié a ce matricule.
merci d'avance
j'ai besion d'aide. en gros voici mon probleme
<form id="form1" name="form1" method="post" action="">j'ai ce formulaire dans lequel j'ai 2 champs texte et j'ai aussi une base de donnée.
matricule:
<label>
<input type="text" name="textfield" id="textfield" />
</label>
nom beneficiaire:
<label>
<input type="text" name="textfield2" id="textfield2" />
</label>
</form>
o fait je veux fait ceci quand on rentre le matricule d'un individu je veux que dans l'autre champs s'affiche le noms lié a ce matricule.
merci d'avance
2 réponses
Salut, il faut utiliser AJAX dans ce cas (ou sinon faire un 2 ème formulaire qui va tenir compte du 1er) mais déjà on peut remarquer plusieurs problème dans votre formulaire:
Il n'y a pas de bouton pour l'envoyer.
Vous avez Method="POST" mais pas de destination de fichier de traitement(Action="") pour ce formulaire.
Il n'y a pas de bouton pour l'envoyer.
Vous avez Method="POST" mais pas de destination de fichier de traitement(Action="") pour ce formulaire.
<form action="editercheque.php" method="post"><table width="98%" border="0">voici le formulaire en question. et je veux faire ce que je vous ai demande plus en haut. pouvez vous me donnez le code pour le faire car je maitrise pas javascript et ajax
<tr>
<td width="25%" height="39" valign="bottom"><span class="Style11">Numéro de police </span></td>
<td width="25%" valign="bottom"><label>
<input type="text" name="police" id="police">
</label></td>
<td width="8%"> </td>
<td width="17%" valign="bottom" class="Style11">Nom et Prénoms </td>
<td width="25%" align="center" valign="bottom"><label>
<input type="text" name="nom" id="nom">
</label></td>
</tr>
<tr bgcolor="#33CCFF">
<td height="17" colspan="5" valign="bottom" bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td height="39" valign="bottom"><span class="Style11">Date</span></td>
<td valign="bottom"><label>
<input type="date" name="date" id="date"></label></td>
<td> </td>
<td valign="bottom" class="Style11">Vouchers </td>
<td align="center" valign="bottom"><label>
<input type="text" name="textfield4" id="textfield4">
</label></td>
</tr>
<tr>
<td height="17" colspan="5" valign="bottom" bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td height="1" colspan="5" valign="bottom"> </td>
</tr>
<tr>
<td height="39" align="center" valign="bottom" background="images/Sans-titre-1.gif" class="Style11">Transactions</td>
<td valign="bottom"> </td>
<td> </td>
<td valign="bottom"> </td>
<td align="center" valign="bottom" background="images/Sans-titre-1.gif" class="Style11">Montants</td>
</tr>
<tr>
<td height="39" valign="bottom"><label>
<input type="text" name="trans1" id="trans1">
</label></td>
<td valign="bottom"> </td>
<td> </td>
<td valign="bottom"> </td>
<td align="center" valign="bottom"><label>
<input type="text" name="mon1" id="mon1">
</label></td>
</tr>
<tr>
<td height="39" valign="bottom"><label>
<input type="text" name="trans2" id="trans2">
</label></td>
<td valign="bottom"> </td>
<td> </td>
<td valign="bottom"> </td>
<td align="center" valign="bottom"><label>
<input type="text" name="mon2" id="mon2">
</label></td>
</tr>
<tr>
<td height="39" valign="bottom"><label>
<input type="text" name="trans3" id="trans3">
</label></td>
<td valign="bottom"> </td>
<td> </td>
<td valign="bottom"> </td>
<td align="center" valign="bottom"><label>
<input type="text" name="mon3" id="mon3">
</label></td>
</tr>
<tr>
<td height="39" valign="bottom"><label>
<input type="text" name="trans4" id="trans4">
</label></td>
<td valign="bottom"> </td>
<td> </td>
<td valign="bottom"> </td>
<td align="center" valign="bottom"><label>
<input type="text" name="mon4" id="mon4">
</label></td>
</tr>
<tr>
<td height="39" valign="bottom"><label>
<input type="text" name="trans5" id="trans5">
</label></td>
<td valign="bottom"> </td>
<td> </td>
<td valign="bottom"> </td>
<td align="center" valign="bottom"><label>
<input type="text" name="mon5" id="mon5">
</label></td>
</tr>
<tr>
<td height="39" valign="bottom"><label>
<input type="text" name="trans6" id="trans6">
</label></td>
<td valign="bottom"> </td>
<td> </td>
<td valign="bottom"> </td>
<td align="center" valign="bottom"><label>
<input type="text" name="mon6" id="mon6">
</label></td>
</tr>
<tr>
<td height="39" valign="bottom"><label>
<input type="text" name="trans7" id="trans7">
</label></td>
<td valign="bottom"> </td>
<td> </td>
<td valign="bottom"> </td>
<td align="center" valign="bottom"><label>
<input type="text" name="mon7" id="mon7">
</label></td>
</tr>
<tr>
<td height="39" valign="bottom"><label>
<input type="text" name="trans8" id="trans8">
</label></td>
<td valign="bottom"> </td>
<td> </td>
<td valign="bottom"> </td>
<td align="center" valign="bottom"><label>
<input type="text" name="mon8" id="mon8">
</label></td>
</tr>
<tr>
<td height="39" valign="bottom"><label>
<input type="text" name="trans9" id="trans9">
</label></td>
<td valign="bottom"> </td>
<td> </td>
<td valign="bottom"> </td>
<td align="center" valign="bottom"><label>
<input type="text" name="mon9" id="mon9">
</label></td>
</tr>
<tr>
<td height="39" valign="bottom"><label>
<input type="text" name="trans10" id="trans10">
</label></td>
<td valign="bottom"> </td>
<td> </td>
<td valign="bottom"> </td>
<td align="center" valign="bottom"><label>
<input type="text" name="mon10" id="mon10">
</label></td>
</tr>
<tr>
<td height="39" colspan="4" rowspan="2" valign="bottom" bgcolor="#CCCCCC" class="Style11 Style12">Total</td>
<td height="7" align="center" valign="bottom" bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td height="32" align="center" valign="bottom" bgcolor="#FFFFFF"><?php if (isset($erreur)) echo '<br /><font color="#FF0000" size="2" weight="bold">'.$erreur.'</font>'; ?></td>
</tr>
<tr>
<td height="39" colspan="4" valign="bottom"> </td>
<td align="center" valign="bottom"><label>
<input type="submit" name="button" id="button" value="Valider">
</label></td>
</tr>
</table>
</form>