Précédent   Forum des professionnels en informatique > PHP > Bibliothèques et frameworks
Bibliothèques et frameworks Forum d'entraide sur les frameworks, templates, bibliothèques de code (PDFLib, eZPdf, JpGraph, Artichow, PEAR, etc). Avant de poster : FAQ bibliothèques, toutes les FAQ PHP et cours bibliothèques
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 11/04/2011, 17h37   #1
Invité de passage
 
Femme Nina
Inscription : juin 2006
Messages : 13
Détails du profil
Informations personnelles :
Nom : Femme Nina

Informations forums :
Inscription : juin 2006
Messages : 13
Points : 1
Points : 1
Par défaut problème validation de date codeigniter

Bonjour,

J'utilise cette librairie http://codeigniter.com/wiki/FormDate/ pour générer des select (jours/mois/ annee)
mais je ne comprends pas la validation des dates

Comment appliquer une règle de validation simple d'autant que je genère pas mal de date fields sur le même formulaire.

voila mon controller
Code :
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
$startdate1 = new FormDate();
$startdate1->config['prefix']="start_1_"; 
$startdate1->setLocale('nl_BE');
$startdate1->year['start'] = 2011;
$startdate1->year['end'] = 2015;
$startdate1->month['values'] = 'numbers'; 
$data['startdate1'] = $startdate1;
 
$enddate1 = new FormDate();
$enddate1->config['prefix']="end_1_";
$enddate1->setLocale('nl_BE');
$enddate1->year['start'] = 2011;
$enddate1->year['end'] = 2015;
$enddate1->month['values'] = 'numbers'; 
$data['enddate1'] = $enddate1;
 
$startdate2 = new FormDate();
$startdate2->config['prefix']="start_2_"; 
$startdate2->setLocale('nl_BE');
$startdate2->year['start'] = 2011;
$startdate2->year['end'] = 2015;
$startdate2->month['values'] = 'numbers'; 
$data['startdate2'] = $startdate2;
 
$enddate2 = new FormDate();
$enddate2->config['prefix']="end_2_";
$enddate2->setLocale('nl_BE');
$enddate2->year['start'] = 2011;
$enddate2->year['end'] = 2015;
$enddate2->month['values'] = 'numbers'; 
$data['enddate2'] = $enddate2;
 
$startdate3 = new FormDate();
$startdate3->config['prefix']="start_3_"; 
$startdate3->setLocale('nl_BE');
$startdate3->year['start'] = 2011;
$startdate3->year['end'] = 2015;
$startdate3->month['values'] = 'numbers'; 
$data['startdate3'] = $startdate3;
 
$enddate3 = new FormDate();
$enddate3->config['prefix']="end_3_";
$enddate3->setLocale('nl_BE');
$enddate3->year['start'] = 2011;
$enddate3->year['end'] = 2015;
$enddate3->month['values'] = 'numbers'; 
$data['enddate3'] = $enddate3;
et ma vue
Code :
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
// SESSION 1
echo "<div id='session_1'>Form :&nbsp;";
echo $startdate1->selectDay();
echo $startdate1->selectMonth();
echo $startdate1->selectYear();
echo "&nbsp;To :&nbsp;";
echo $enddate1->selectDay();
echo $enddate1->selectMonth();
echo $enddate1->selectYear();
echo "</div>";
echo br();
// SESSION 2
echo "<div id='session_2'>Form :&nbsp;";
echo $startdate2->selectDay();
echo $startdate2->selectMonth();
echo $startdate2->selectYear();
echo "&nbsp;To :&nbsp;";
echo $enddate2->selectDay();
echo $enddate2->selectMonth();
echo $enddate2->selectYear();
echo "</div>";
echo br();
// SESSION 3
echo "<div id='session_3'>Form :&nbsp;";
echo $startdate3->selectDay();
echo $startdate3->selectMonth();
echo $startdate3->selectYear();
echo "&nbsp;To :&nbsp;";
echo $enddate3->selectDay();
echo $enddate3->selectMonth();
echo $enddate3->selectYear();
echo "</div>";
echo br();

merci d'avance
supersonicblonde est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 00h56.


 
 
 
 
Partenaires

Hébergement Web