Creer un nouveou input et select

hazem.abd Messages postés 7 Statut Membre -  
hazem.abd Messages postés 7 Statut Membre -
Bonjour,
<select name = "piece_selectionnee" style="width:150">
<option selected="selected">aucune</option>
<?php
while($donne = mysql_fetch_array($rep)){

echo '<option> '.$donne['libelle'].' </option>';
}
?>
</select>
</td>

<td align = "right"> Choisir un acte:
<select name = "acte" style="width:150;">
<option selected="selected">aucun</option>
<option>reparation</option>
<option>Changement</option>

</select>
</td>

<td align = "right">
MO : <input type = "text" name = "mo">
</td>

<td align = "right">
Pein : <input type = "text" name = "peint">
</td>

<td align = "right">
<input type = "submit" value = "Ajouter" name = "Ajoutez">
</td>
</tr>


je veux qu'apres chaque clique sur le bouton ajoutez on cree les memes champs de nouveau.




A voir également:

2 réponses

boyback Messages postés 243 Statut Membre 23
 
Je n'y connais pas grand chose en programmation, mais peut etre une piste.. Tu met un "input" sans balise <form> avant et apres pour fermer. Tu peux mettre :

<form action="ta-page.html">
<input......>
</form>

Comme ca lorsque tu cliquera sur ajouter ca t'enverra sur la meme page (a condition de la mettre dans le form) et donc tu retrouvera tes formulaires.

J'espere t'avoir aider, pour plus de precision n'hesite pas.
0
boyback Messages postés 243 Statut Membre 23
 
*
< form action="ta-page.html" >
< input ....>
< / form>
0
hazem.abd Messages postés 7 Statut Membre
 
bonjour , voici au claire la situation
<form  name = "formulaire" method = "Post" action = " "   onSubmit="return verif_formulaire()">
<table  align = "center" >			<?php
			                mysql_connect('localhost','root','');
			                mysql_select_db('evaluation_sinistre');
			                $sql='select libelle from piece';
			                $rep=mysql_query($sql) or die(mysql_error());
			                $i=1;
		                    
			
		          	?>
			<tr>
				
				<td align = "right"> Choisir une piece:
				
					<select name = "piece_selectionnee"  style ="width:150">
					  <option selected="selected">aucune</option>
						<?php
                              while($donne = mysql_fetch_array($rep)){ 	
							  
							  echo '<option> '.$donne['libelle'].' </option>'; 
							 } 
							 ?>
					</select>
				 </td> 
				 				 
				 <td align = "right"> Choisir un acte:
					<select name = "acte" style="width:150;"> <option selected="selected">aucun</option>
											<option>reparation</option>

											<option>Changement</option>
											
					</select>
				</td>
				
				<td align = "right">
				                 MO : <input type = "text" name = "mo">
				</td>
				
				<td align = "right">
				                Pein : <input type = "text" name = "peint">
				</td>
						
						<td align = "right"> 
								<input type = "button" value = "Ajouter" name = "Ajoutez" onclick ="alert('Bonjour');">
						</td>
			</tr> 
je veux en cliquant sur le bouton ajouter l'evenevement reproduit la meme ligne et merci d'avance
0