pb en JS - Programmation
Marsh Posté le 19-10-2001 à 02:12:15
oui c'est possible:
> <html>
> <script>
>
> function recup_data()
> {
> var longueur_select = document.mon_form.mon_select.length;
>
> for (x=0; x<longueur_select; x++)
> {
> valeur = document.mon_form.mon_select.options[x].value;
> texte = document.mon_form.mon_select.options[x].text;
>
> alert (valeur+"\n"+texte);
> }
>
>
>
> return false;
> }
>
> </script>
>
>
> <body>
>
> <form name="mon_form">
>
> <select name="mon_select">
> <option value="value_1">txt 1
> <option value="value_2">txt 2
> <option value="value_3">txt 3
> <option value="value_4">txt 4
> </select>
>
> <br>
> <br>
> <br>
> <a href="#" onClick="return recup_data()">un lien</a>
>
> </form>
> </html>
tout simplement...
Marsh Posté le 18-10-2001 à 16:02:15
est-il possible de récupérer toutes les valeurs d'une liste ?
normalement c'est la première par défaut ou celle qui est sélectionnée.
je veux récupérer touce qu'il y a dans une liste.
possible ?