pré sélectionner un élément d'une liste
Bonjour,
Je débute en php xhtml et j'ai une question toute simple enfin j'espère!:lol:
Je voudrais savoir si cela est possible de pré sélectionner un élement d'une liste selon une valeur définit dans $donnees
J'ai fait cela pour le moment mais comme pas grand chose ne marche je ne suis pas sûre que cela soit possible! pouvez-vous me dire si c'est correcte où sinon comment il faut faire!
Merci :ccool:
Code:
1 2 3 4 5 6 7 8
|
<label for="sex"> Patient Sex: </label>
<input type="radio" name="sex" value="Woman" id="woman" checked =" <?php if ($donnees['sexpatient'] == 'woman') echo "checked" ; ?>" /> Woman
<input type="radio" name="sex" value="Man" id="man" checked ="<?php if ($donnees['sexpatient'] == 'man') echo "checked" ; ?>" /> Man
<label for="localisation"> Exam Localisation: </label>
<select name="localisation" id="localisation" />
<option value='ABD'checked=" <?php if ($donnees['localisation'] == 'ABD') echo "checked" ; ?>" >ABC </option>
<option value='ANKLE' checked=" <?php if ($donnees['localisation'] == 'ANKLE') echo "checked" ; ?>" >ANKLE</option> |