Bonjour,
mon problème est bien du PHP et non du javascript car si le formulaire (datepicker) est en javascript, les données récupérées sont des variables PHP...du moins on l'espère car dans mon cas,Donc je n'arrive pas à récupérer ces données ; que faudrait-il faire ?Undefined index: datapickerd in C:\wamp\www\eis\eis\calendar-pdo\admin\enterdata.php on line 3
formulaire datepicker :
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Ajout d'un évènement</title> <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <script> $(function() { $( "#datepickerd" ).datepicker(); }); $(function() { $( "#datepickerf" ).datepicker(); }); </script> </head> <body> <?php displayForm(); function displayForm($result = array()) { echo '<form action="enterdata.php" method="POST">'; echo '<table><tr><td>Date de début: </td><td> <input type="text" id="datepickerd" name="datepickerd"></td></tr> <tr><td>Date de fin: </td><td><input type="text" id="datepickerf" name="datepickerf" ></td></tr></table>'; echo '<br/><input type="submit" value="OK">'; echo '</form>'; } ?> </body> </html>
récupération des données (enterdata.php) :
qui donne
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 <?php echo "deb=".$_POST["datapickerd"]."<br/>"; echo "fin=".$_POST["datapickerf"]."<br/>"; ?>( ! ) Notice: Undefined index: datapickerd in C:\wamp\www\eis\eis\calendar-pdo\admin\enterdata.php on line 3
deb=
( ! ) Notice: Undefined index: datapickerf in C:\wamp\www\eis\eis\calendar-pdo\admin\enterdata.php on line 4
fin=
Partager