Il y a toujours le problème de la date, mon problème se situe au niveau de saisie, je pense qu'avec un calendrier, ça serait mieux... ou du moins pour l'utilisateur.
J'ai ajouté un calendrier mais celui-ci est en anglais...
Voici mon code complet :
[javascript]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="
http://ajax.googleapis.com/ajax/libs/jq ... "></script>
<title>Document sans titre</title>
<script type="text/javascript">
$(document).ready(function () {
$("#bAdd").click(function(){
if ($('#date2').length <= 0){//on verifie que l'input et pas deja present
$("#trAdd").after('<tr><td><label for="date"><strong>Date 2 :</strong></label></td><td><input type="text" name="date2" id="date2" /></td></tr>');
}
});
});
</script>
<link rel="stylesheet" href="
http://ajax.googleapis.com/ajax/libs/jq ... ery-ui.css" type="text/css" media="all" />
<link rel="stylesheet" href="
http://static.jquery.com/ui/css/demo-do ... .theme.css" type="text/css" media="all" />
<script src="
http://jquery-ui.googlecode.com/svn/tru ... "></script>
<script src="
http://ajax.googleapis.com/ajax/libs/jq ... ery.min.js" type="text/javascript"></script>
<script src="
http://ajax.googleapis.com/ajax/libs/jq ... -ui.min.js" type="text/javascript"></script>
</head>
<body>
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
[/javascript]
<form name="ajout" action="formation.php" method="POST">
<table>
<tr>
<td><label for="nom"><strong>Nom de la formation :</strong></label></td>
<td><input type="text" name="nom" required title="Entrez ici le nom de la formation"/></td>
</tr>
<td><label for="date"><strong>Date de formation :</strong></label></td>
<td><input type="date" id="datepicker" name="date"> </td>
<tr id="trAdd">
<?php
include("connexion.php");
$req= "ALTER TABLE Formation ADD date2 DATE NOT NULL";
$result= mysql_query($req);
?>
<td> <input type="button" id="bAdd" value="Ajouter" /></td>
</tr>
</table>
<table>
<br/>
<br/>
<input type="submit" name="register" value="Ajouter une formation" />
</table>
</form>
</body>
</html>