Ajouter dynamiquement de champ

  • Auteur de la discussion BestHUnter
  • Date de début

BestHUnter

Nouveau membre
Bonsoir,
j'ai un formulaire qui contient 3 champs du texte et un bouton ( ) je veux quand j’appuie sur le bouton les 3 champs se répètent au dessus du 1er formulaire voila le code html


<html><head><title>ajout dynamique</title></head>
<body>
<table width="148%">
<td width="32%" height="26" align="center">Année d'obtention
du Diplôme</td>
<td width="33%" align="center">Diplôme</td>
<td width="32%" align="center">Etablissement</td>
</tr>
<tr>
<td height="26" align="center"> <input name="annee_formation1" type="text" class="form_pt_center" id="ann?formation1" tabindex="24" maxlength="50">
</td>
<td align="center"><input name="diplome_formation1" type="text" class="form_pt_center" id="diplome_formation1" tabindex="25" maxlength="50"></td>
<td align="center"><input name="etablissement_formation1" type="text" class="form_pt_center" id="etablissement_formation1" tabindex="26" maxlength="50"></td>
<td align="center"><input type="button" value="+"tabindex="26" maxlength="50"></td>
</table>
<p>&nbsp;</p>
</body></html>
 

zeb

Modérateur
Salut BestHunter
Et bienvenu dans la partie Programmation de ce forum.

Merci de bien vouloir lire le règlement spécifique à cette partie (cf. ma signature) et de modifier en conséquence ton message : ici, toute pièce de code doit être présentée entre les balises
Code:
[[i]/[/i]code].

Je n'ai pas bien compris ce que tu voulais. Pourrais-tu reformuler ?
 

BestHUnter

Nouveau membre
Salut,
j'ai 3 champs du texte et un bouton, je veux quand j'appuie sur le bouton les 3 champs se répètent automatiquement voila le code html:
<code>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ajout-dyn</title>
</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr align="left">
<td height="26" colspan="3"><strong>Formations :</strong></td>
</tr>
<tr>
<td width="33%" height="26" align="center">Année d'obtention
du Diplôme</td>
<td width="34%" align="center">Diplôme</td>
<td width="33%" align="center">Etablissement</td>
</tr>
<tr>
<td height="26" align="center"><input name="annee_formation1" type="text" class="form_pt_center" id="ann?formation1" tabindex="24" maxlength="50" /></td>
<td align="center"><input name="diplome_formation1" type="text" class="form_pt_center" id="diplome_formation1" tabindex="25" maxlength="50" /></td>
<td align="center"><input name="etablissement_formation1" type="text" class="form_pt_center" id="etablissement_formation1" tabindex="26" maxlength="50" />
<input type="button" value="+"/></td>
</tr>
</tbody>
</table>
</body>
</html>
</code>
 
Vous devez vous inscrire ou vous connecter pour répondre ici.
Derniers messages publiés
Statistiques globales
Discussions
730 098
Messages
6 717 064
Membres
1 586 286
Dernier membre
petitangebleu1977
Partager cette page
Haut