Bonjour tout le monde,
Voila, je réalise un site en php avec du langage html.
L'utilisateur doit configurer son produit à l'aide de bouton radio et de formulaire.
Je voudrais que si l'utilisateur n'a pas sélectionner les choix, un message d'alerte s'affiche en disant "veuillez choisir vos options pour votre produit". Bien sur, je pense qu'il faut utiliser un script javascript qui verifira les boutons radios checked ou non. Ne connaissant rien en javascript, je demande votre aide s'il vous plait.
Mon formulaire :
print'<form name="step1" method="post" action="products/hopper-weighing/'.$HopperWeighing.'-2.php">';
print'<p>What is the weight of your hopper when it is empty?</p>';
?>
<input type="radio" name="empty1" value=1 <?php if ($_POST['empty1'] == 1) {echo "checked";} ?>>Less than 1 tonne
<BR>
<INPUT type="radio" name="empty1" value=2 <?php if ($_POST['empty1'] == 2) {echo "checked";} ?>>Less than 2 tonnes
<BR>
<INPUT type="radio" name="empty1" value=5 <?php if ($_POST['empty1'] == 5) {echo "checked";} ?>>Less than 5 tonnes
<BR>
<INPUT type="radio" name="empty1" value=10 <?php if ($_POST['empty1'] == 10) {echo "checked";} ?>>Less than 10 tonnes
<BR>
<INPUT type="radio" name="empty1" value=15 <?php if ($_POST['empty1'] == 15) {echo "checked";} ?>>Less than 15 tonnes
<?php
Je vous remercie pour votre aide
A plus tard
Configuration: Windows XP
Firefox 2.0.0.14