Bonjour,
je viens vers vous aujourd'hui pour un petit problème d'affichage.
j'ai un fichier PHP qui génère du html à partir d'XML.
J'aimerai remplacer les boutons radio courant par des images entièrement créées en CSS3.
voici un extrait du code de mon XML :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 <question label="1. Le questionnaire a-t-il été complété?" type="radio" reponse="non;;;oui" class="condition"> <question label="Si non, préciser:" type="radio" reponse="Refus;;;Abandon;;;Incapacité" class='choices'> <tableau niveau="td" type="radio" label="Ne sait pas." class="dontknow"/>
Voici mon php :
Et enfin, voici mon CSS :
Code : 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 function afficherquestion() { $htmlstr = "<table class='page'>"; $htmlstr .= "<tr><td>"; $htmlstr .= $this->label; $htmlstr .="</td><br/><td>"; switch ($this->type){ case 'radio': //si c'est un "radio", alors on affiche 3 champs radio. $userchoice=explode(';;;', $this->reponse); foreach ($userchoice as $radio){ $htmlstr.="<br/><input type='radio' value='".$radio."name='".$this->variable."' class='condition'/>".$radio."\n" ; } break; } $htmlstr .="</td></tr>"; $htmlstr .="</table>"; echo $htmlstr; }
Comment lier le tout? Merci!!!
Code : 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
34
35
36
37
38
39
40
41
42 .input[type=radio]#choices{ display:inline -moz-border-radius:13px 13px 13px 13px; -moz-box-shadow:0 1px 0 #000000; background:-moz-linear-gradient(center top , #EB6B09, #F2E48C) repeat scroll 0 0 transparent; border-top:1px solid #FA9C61; color:#FFFFFF; font-family:Georgia,Serif; font-size:10px; font-weight:bold; padding:6px 12px; text-decoration:none; text-shadow:0 1px 0 rgba(0, 0, 0, 0.4); vertical-align:middle; } .input[type=radio]#dontknow{ -moz-border-radius:14px 14px 14px 14px; -moz-box-shadow:0 1px 0 #000000; background:-moz-linear-gradient(center top , #EB6B09, #F2E48C) repeat scroll 0 0 transparent; border-top:1px solid #FA9C61; color:#FFFFFF; font-family:Georgia,Serif; font-size:23px; padding:12px 24px; text-decoration:none; text-shadow:0 1px 0 rgba(0, 0, 0, 0.4); vertical-align:middle; } .input[type=radio]#dontknow:hover { background:none repeat scroll 0 0 #F06013; border-top-color:#F06013; color:#F7F436; } .input[type=radio]#dontknow:active { background:none repeat scroll 0 0 #F5EBEB; border-top-color:#F5EBEB; } ...etc....
Partager