Un select sous netscape...
Cédric
-
PhP -
PhP -
Bonjour,
je réalise actuellement un site qui doit fonctionner sous netscape... avec des pages jsp
J'effectue un select, et je n'arrive pas a recuperer le value du select sous netscape 4.x...
Alors comment faire, si l'un de vous peu m'eclairer....
Merci et bonne journée.
Cédric
je réalise actuellement un site qui doit fonctionner sous netscape... avec des pages jsp
J'effectue un select, et je n'arrive pas a recuperer le value du select sous netscape 4.x...
Alors comment faire, si l'un de vous peu m'eclairer....
Merci et bonne journée.
Cédric
A voir également:
- Un select sous netscape...
- Select boot mode android - Guide
- Reboot and select proper boot device asus - Forum Matériel & Système
- Please select boot device - Forum Windows 7
- Diskpart select disk - Guide
- Reboot and select proper boot device - Forum BIOS
1 réponse
Salut Cédric
Voici un ex html qui devrait résoudre tes pbs de select
Lit le code JavaScript des fonctions
J'ai un formulaire que j'appelle "fiche" avec une liste à l'intérieur "choix"
Tout repose sur le tableau options[] associé systèmatiquement à chaque liste par le système.
<html>
<head>
<title>Nouvelle page 1</title>
<script>
<!--
function tester_option(i)
{
var i=window.document.fiche.ind.value;
var mx=window.document.fiche.choix.options.length
mx--
if ((i > mx) || (i <0))
{
alert("Entrez un indice compris entre 0 et "+mx+" !")
return
}
window.document.fiche.tst.value=window.document.fiche.choix.options[i].selected
window.document.fiche.dft.value=window.document.fiche.choix.options[i].defaultSelected;
}
function selectionner_option(i)
{
var i=window.document.fiche.sel.value;
var mx=window.document.fiche.choix.options.length
mx--
if ((i > mx) || (i <0))
{
alert("Entrez un indice compris entre 0 et "+mx+" !")
return
}
window.document.fiche.choix.options[i].selected=true
}
function info()
{
var i=window.document.fiche.choix.selectedIndex;
window.document.fiche.idx.value=i;
window.document.fiche.val.value=window.document.fiche.choix.options[i].text;
window.document.fiche.nbr.value=window.document.fiche.choix.options.length;
}
// -->
</script>
</head>
<body onload="info()">
A propos de SELECT dans les formulaires (marche avec IE et NS)
<form name=fiche>
Choisir un élément dans la liste ->
<select name="choix" onchange="info()">
<option selected>Premier
<option>Second
<option>Troisième
<option>Etc ...
</select><br>
Nbre d'options : <input type="text" name="nbr" value="" size=3><br>
Index sélectionné : <input type="text" name="idx" value="" size=3><br>
Valeur sélectionnées : <input type="text" name="val" value="" size="30"><br>
<br><br>
Tester si un élément est sélectionné :<br>
Entrer l'indice de l'élément à tester : <input type="text" name="ind" value="" size="4">
<input type="button" value="Tester" onclick="tester_option()"><br>
Résultat : Actuellement sélectionné ? <input type="text" name="tst" value="" size="6">
Sélectionné par défaut ? <input type="text" name="dft" value="" size="6">
<br><br>
Sélection d'un élément :<br>
Entrer l'indice de l'élément à sélectionner : <input type="text" name="sel" value="" size=3>
<input type="button" value="Sélectionner" onclick="selectionner_option();info()"><br>
</form>
</body>
</html>
Voilà en espérant que ce t'aideras
@+
Philippe
Voici un ex html qui devrait résoudre tes pbs de select
Lit le code JavaScript des fonctions
J'ai un formulaire que j'appelle "fiche" avec une liste à l'intérieur "choix"
Tout repose sur le tableau options[] associé systèmatiquement à chaque liste par le système.
<html>
<head>
<title>Nouvelle page 1</title>
<script>
<!--
function tester_option(i)
{
var i=window.document.fiche.ind.value;
var mx=window.document.fiche.choix.options.length
mx--
if ((i > mx) || (i <0))
{
alert("Entrez un indice compris entre 0 et "+mx+" !")
return
}
window.document.fiche.tst.value=window.document.fiche.choix.options[i].selected
window.document.fiche.dft.value=window.document.fiche.choix.options[i].defaultSelected;
}
function selectionner_option(i)
{
var i=window.document.fiche.sel.value;
var mx=window.document.fiche.choix.options.length
mx--
if ((i > mx) || (i <0))
{
alert("Entrez un indice compris entre 0 et "+mx+" !")
return
}
window.document.fiche.choix.options[i].selected=true
}
function info()
{
var i=window.document.fiche.choix.selectedIndex;
window.document.fiche.idx.value=i;
window.document.fiche.val.value=window.document.fiche.choix.options[i].text;
window.document.fiche.nbr.value=window.document.fiche.choix.options.length;
}
// -->
</script>
</head>
<body onload="info()">
A propos de SELECT dans les formulaires (marche avec IE et NS)
<form name=fiche>
Choisir un élément dans la liste ->
<select name="choix" onchange="info()">
<option selected>Premier
<option>Second
<option>Troisième
<option>Etc ...
</select><br>
Nbre d'options : <input type="text" name="nbr" value="" size=3><br>
Index sélectionné : <input type="text" name="idx" value="" size=3><br>
Valeur sélectionnées : <input type="text" name="val" value="" size="30"><br>
<br><br>
Tester si un élément est sélectionné :<br>
Entrer l'indice de l'élément à tester : <input type="text" name="ind" value="" size="4">
<input type="button" value="Tester" onclick="tester_option()"><br>
Résultat : Actuellement sélectionné ? <input type="text" name="tst" value="" size="6">
Sélectionné par défaut ? <input type="text" name="dft" value="" size="6">
<br><br>
Sélection d'un élément :<br>
Entrer l'indice de l'élément à sélectionner : <input type="text" name="sel" value="" size=3>
<input type="button" value="Sélectionner" onclick="selectionner_option();info()"><br>
</form>
</body>
</html>
Voilà en espérant que ce t'aideras
@+
Philippe