Bonjour,
J'ai fait ce programme mais quand je clique sur commander, rien ne s'affiche, quelqu'un peut m'aider ?
<!DOCTYPE html> <html lang="fr"> <head> <meta charset="UTF-8"> <link href="http://fr.allfont.net/allfont.css?fonts=montserrat-bold" rel="stylesheet" type="text/css" /> <link rel="stylesheet" type="text/css" href="./style/style.css"/> <title> Service Pizza </title> <script src="./scripts/date_heure.js"></script> </head> <body> <article id='scroll'> <img id='logo' src='./imagespizza/logopizza.png' alt='Logo' title='Logo' width="150"/> </article> <form> <article id='backgroundtitre'> <h2 id='titre'>Service de livraison de pizza à domicile</h2> <div id='trait1' class='trait'></div> <section id='coordonnees'> <h2 id='adnom'>Vos coordonnées</h2> <input class='inputtext' placeholder='Nom' type='text' name='nom' value=''><br><br> <input class='inputtext' placeholder='Adresse' type='text' name='adresse' value=''><br> <p><a href='https://www.youtube.com/watch?v=bhZs3ALdL7Y'><img id="attention" src="./imagespizza/attention.png" alt="Attention" title="Attention" width="15"/></a>Si l'adresse est fausse, vous ne serez pas livrés.</p> </section> <section id='choix'> <h2 id='pizza'>Votre Pizza</h2> <h3><span class='sous-parties'>Dimensions : </span><select class='boutton' name="sizelist" form='sizelist'> <option name='diametre' value="bambino">Bambino (-12 ans) : 17cm, 5€</option> <option name='diametre' value="petite">Petite : 24cm, 7,50€</option> <option name='diametre' value="moyenne">Moyenne : 30cm, 10€</option> <option name='diametre' value="grande">Grande : 36cm, 11,50€</option> </select> </h3> <article id='fondbois'><h2 id='ingredient'>Ingrédients : </h2> <h3><span class='sous-parties' id='sous-parties1'>Base :</span></h3> <input class='input' type="radio" name="base" value="Sauce Tomate">Sauce Tomate<br> <input class='input' type="radio" name="base" value="Crème Fraiche">Crème Fraiche<br> <br><br><div id='trait2' class='trait'></div><br> <h3><span class='sous-parties' id='sous-parties2'>Viande :</span></h3> <input class='input' type="radio" name="viande" value="Jambon blanc">Jambon blanc<br> <input class='input' type="radio" name="viande" value="bacon">Bacon<br> <input class='input' type="radio" name="viande" value="boeuf">Boeuf haché<br> <input class='input' type="radio" name="viande" value="creme">Poulet<br> <br><br><div id='trait3' class='trait'></div><br> <h3><span class='sous-parties' id='sous-parties3'>Fromage :</span></h3> <input class='input' type="radio" name="fromage" value="origan">Emmental<br> <input class='input' type="radio" name="fromage" value="cantamil">Cantamil<br> <input class='input' type="radio" name="fromage" value="mozzarella">Mozzarella<br> <br><br><div id='trait4' class='trait'></div><br> <h3><span class='sous-parties' id='sous-parties4'>Supplément : (+1,50€)</span></h3> <input class='input' type="radio" name="supplement" value="champignons">Champignons<br> <input class='input' type="radio" name="supplement" value="ananas">Ananas<br> <input class='input' type="radio" name="supplement" value="truffe">Truffe<br> <input class='input' type="radio" name="supplement" value="oeuf">Oeuf<br> <br><br><br><br><br> <input type="submit" class='boutton' value="Commander" onclick="check();"> <br><br><br><br><br><br><br> </article> </section> </article> </form> <footer> <p> Copyright © 2019-2020 | Première-NSI | CASTEL Nicolas | JAMOTEAU Yohann | <span id="date_heure"></span></p> </footer> <script src="./scripts/date_heure.js"></script> <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script> <script src='./scripts/background_onscroll.js'></script> <script src='./scripts/formulaire.js'></script> <script>window.onload = date_heure('date_heure');</script> </body> </html>
<!DOCTYPE html> <html lang="fr"> <head> <meta charset="UTF-8"> <link href="http://fr.allfont.net/allfont.css?fonts=montserrat-bold" rel="stylesheet" type="text/css" /> <link rel="stylesheet" type="text/css" href="./style/style.css"/> <title> Service Pizza </title> <script src="./scripts/date_heure.js"></script> </head> <body> <article id='scroll'> <img id='logo' src='./imagespizza/logopizza.png' alt='Logo' title='Logo' width="150"/> </article> <form> <article id='backgroundtitre'> <h2 id='titre'>Service de livraison de pizza à domicile</h2> <div id='trait1' class='trait'></div> <section id='coordonnees'> <h2 id='adnom'>Vos coordonnées</h2> <input class='inputtext' placeholder='Nom' type='text' name='nom' value=''><br><br> <input class='inputtext' placeholder='Adresse' type='text' name='adresse' value=''><br> <p><a href='https://www.youtube.com/watch?v=bhZs3ALdL7Y'><img id="attention" src="./imagespizza/attention.png" alt="Attention" title="Attention" width="15"/></a>Si l'adresse est fausse, vous ne serez pas livrés.</p> </section> <section id='choix'> <h2 id='pizza'>Votre Pizza</h2> <h3><span class='sous-parties'>Dimensions : </span><select class='boutton' name="sizelist" form='sizelist'> <option name='diametre' value="bambino">Bambino (-12 ans) : 17cm, 5€</option> <option name='diametre' value="petite">Petite : 24cm, 7,50€</option> <option name='diametre' value="moyenne">Moyenne : 30cm, 10€</option> <option name='diametre' value="grande">Grande : 36cm, 11,50€</option> </select> </h3> <article id='fondbois'><h2 id='ingredient'>Ingrédients : </h2> <h3><span class='sous-parties' id='sous-parties1'>Base :</span></h3> <input class='input' type="radio" name="base" value="Sauce Tomate">Sauce Tomate<br> <input class='input' type="radio" name="base" value="Crème Fraiche">Crème Fraiche<br> <br><br><div id='trait2' class='trait'></div><br> <h3><span class='sous-parties' id='sous-parties2'>Viande :</span></h3> <input class='input' type="radio" name="viande" value="Jambon blanc">Jambon blanc<br> <input class='input' type="radio" name="viande" value="bacon">Bacon<br> <input class='input' type="radio" name="viande" value="boeuf">Boeuf haché<br> <input class='input' type="radio" name="viande" value="creme">Poulet<br> <br><br><div id='trait3' class='trait'></div><br> <h3><span class='sous-parties' id='sous-parties3'>Fromage :</span></h3> <input class='input' type="radio" name="fromage" value="origan">Emmental<br> <input class='input' type="radio" name="fromage" value="cantamil">Cantamil<br> <input class='input' type="radio" name="fromage" value="mozzarella">Mozzarella<br> <br><br><div id='trait4' class='trait'></div><br> <h3><span class='sous-parties' id='sous-parties4'>Supplément : (+1,50€)</span></h3> <input class='input' type="radio" name="supplement" value="champignons">Champignons<br> <input class='input' type="radio" name="supplement" value="ananas">Ananas<br> <input class='input' type="radio" name="supplement" value="truffe">Truffe<br> <input class='input' type="radio" name="supplement" value="oeuf">Oeuf<br> <br><br><br><br><br> <input type="submit" class='boutton' value="Commander" onclick="check();"> <br><br><br><br><br><br><br> </article> </section> </article> </form> <script src='./scripts/formulaire.js'></script> <script>window.onload = date_heure('date_heure');</script> </body> </html>
function check() { let message="Cher/Chère M.Mme " message=message+document.forms[0].nom.value message=message+", vous avez choisi une " if (document.forms[0].diametre.options[0].selected){ message=message+"Bambino Pizza" } if (document.forms[0].diametre.options[1].selected){ message=message+"petite Pizza" } if (document.forms[0].diametre.options[2].selected){ message=message+"moyenne Pizza" } if (document.forms[0].diametre.options[3].selected){ message=message+"grande Pizza" } alert(message) }
Afficher la suite