Bonjour,
j'ai un formulaire qui a pour nom form1 et je voudrais rajouter un champ si j'ai cliqué sur un bouton radio. J'ai donc utilisé une fonction de javascript qui me submit le formulaire sans que j'ai à appuyer sur le button valider .
Dans mon formulaire, j'ai testé l'existence de la variable POST associé au champ input de mon radio box. S'il existe, alors j'affiche mon champ (qui est un champ de type file pour upload un fichier), sinon je ne l'affiche pas.
Mais , quans je coche la radio box , rien ne se passe.
Voici mon code
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 echo" <form name='formu1' action='".$action_form."' method='post' > <label for='icone'> </icone> <table border='0'> <TR><th ><B>Numéro</B></th> <th> <input type='text' size='7' name='numero' value='".$numero."'></th></TR> <TR ><th> Voulez vous upload un fichier?</th> <th><input type='checkbox' name='nocturne' onclick='javascript: window.document.forms['formu1'].submit();'"; if (isset($_POST['nocturne'])) echo 'checked'; echo '>Oui'; if (isset($_POST['nocturne'])) echo " <TR ><th ALIGN='LEFT' COLSPAN='2'> <input type='file' name='file' size='20' onchange='javascript: window.document.forms['formu1'].submit();' > </th> </tr> <TR><th ALIGN='center' COLSPAN=2><font size='5'> <p align='center'> <input class='button' type='submit' value='Valider' style='font:Verdana,Helvetica;font-size: 17px;background-color:#FFFFFF;color: #3B46BF;'> <input class='button' type='reset' value='Effacer' style='font:Verdana,Helvetica;font-size: 17px;background-color:#FFFFFF;color: #3B46BF;'> </p> </th></TR> </table> </form>";
Partager