Forums ProgMatique Forum Index Forums ProgMatique
Programmation (C/C++, JAVA, PHP, JavaScript, ...) et Informatique (Webmaster, Web)

Aide formulaire

 
Post new topic   Reply to topic    Forums ProgMatique Forum Index » Programmation » Javascript / AJAX
Previous topic :: Next topic  
Author Message
djeje72


Offline


Joined: 20 Apr 2006
Posts: 1

PostPosted: Thu 20 Apr 2006 - 11:05    Post subject: Aide formulaire Reply with quote

bonjour j'aimerais de l'aide pour faire fonctionner ce document :

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>images</title>
<style type="text/css">
body {text-align:center}
div {margin-top:20px}
</style>

<script type="text/javascript">
var lesChoix=new Array();
var lesImages= new Array();

lesChoix["entree"]= new Array("Taboule","Celeri","Macedoine");
lesChoix["plat"]= new Array("coucous","coq au vin","paella");
lesChoix["dessert"]= new Array("tarte aux pommes","tarte aux myrtilles","gateau au chocolat");

lesImages["entree"]= new Array("taboule.png","celeri.png","macedoine.png");
lesImages["plat"]= new Array("couscous.png","coqauvin.png","paella.png");
lesImages["dessert"]= new Array("tarteauxpommes.png","tarteauxmyrtilles.png","gateauauchocolat.png");

</script>
</head>
<body>
<h1> Le menu </h1>
<div>
<input type="radio" id="entree" name="typePlat" checked="checked" /> Entr&eacute;e
<input type="radio" id="plat" name="typePlat" /> Plat
<input type="radio" id="dessert" name="typePlat" /> Dessert
</div>
<div>
<select id="lstChoix" ">
<option value="taboule"> taboule</option>
<option value="celeri"> celeri</option>
<option value="macedoine"> macedoine </option>
</select>

</div>
<div>
<img id="imgPlat" src="taboule.png" alt="plat" />
</div>


</body>
</html>



----

je débute en javascript et j'aimerais de l'aide pour que ne faite, lorsqu'on choisi un type de plat, cela affiche des plats dans la liste et qu'ensuite une image s'affiche. merci
Back to top
SimMaster
Administrateur
Administrateur

Offline


Joined: 08 May 2005
Posts: 508
Localisation: France

PostPosted: Thu 20 Apr 2006 - 12:43    Post subject: Aide formulaire Reply with quote

Bonjour et Bienvenue

en utilisant l'attribut "onchange"
(http://www.java.scripts-fr.com/scripts.php?js=27)
et en utilisant le DOM si tu ne veux pas raffraichir la page quand tu auras choisit une option

Peut tu entourer ton code de la balise code stp Smile
_________________
SimMaster,
Programmation et informatique
Colorisation syntaxique de codes sources
Outils et services autour de l'adresse IP
Back to top
Visit poster’s website
Display posts from previous:   
Post new topic   Reply to topic    Forums ProgMatique Forum Index » Programmation » Javascript / AJAX All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  

Index | Create a forum | Free support forum | Free forums directory | Report a violation | Conditions générales d'utilisation
Powered by phpBB v2 © 2001, 2005 phpBB Group ¦ Theme: subSilver++