IFRAME+JAVASCRIPT
GOLEMS
-
Utilisateur anonyme -
Utilisateur anonyme -
Bonjour
J'ai un petit pb avec une iframe et du javascript contenu dans la page contenue.
Premier fichier (appel de la page dans une iframe)
---------------------------------------------------------
<iframe name="contenu" src="addSsCateg1.php" width="100%" height="200" frameborder="0" border="0" scrolling="yes" marginheight=0 marginwidth=0 align="center" hspace="0" ></iframe>
Seconf fichier (le javascript : listes déroulantes liées)
------------------------------------------------------------
<head>
<script>
function Choix(form) {
i = form.Rubrique.selectedIndex;
if (i == 0) {
return;
}
switch (i) {
case 1 : var txt = new Array ('Matériel','Poissons','Sécurité'); break;
case 2 : var txt = new Array ('Radioactivité','Information','Mesures'); break;
case 3 : var txt = new Array ('Philosophie','Psychologie','Humour'); break;
}
form.Rubrique.selectedIndex = 0;
for (i=0;i<3;i++) {
form.Page.options[i+1].text=txt[i];
}
}
</script>
</head>
<body>
<FORM>
<TABLE>
<TR>
<TH>Rubriques :</TH>
<TH>Pages :</TH>
</TR>
<TR>
<TD><SELECT NAME="Rubrique" onChange='Choix(this.form)'>
<OPTION>--- Choisissez une rubrique ---</OPTION>
<OPTION>Plongée</OPTION>
<OPTION>Nucléaire</OPTION>
<OPTION>Bonheur</OPTION>
</SELECT></TD>
<TD><SELECT NAME="Page">
<OPTION>--- Choisissez une page ---</OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
</SELECT></TD>
</TR>
</TABLE>
</FORM>
</body>
PROBLEME :
--------------
Il existe bien une liaison entre les deux listes mais le choix sélectionné dans la première liste ne reste pas affiché. Ce prog fonctionne si je n'utilise pas la fonction iframe.
Une soluce ?????
Merci d'avance
Golems
J'ai un petit pb avec une iframe et du javascript contenu dans la page contenue.
Premier fichier (appel de la page dans une iframe)
---------------------------------------------------------
<iframe name="contenu" src="addSsCateg1.php" width="100%" height="200" frameborder="0" border="0" scrolling="yes" marginheight=0 marginwidth=0 align="center" hspace="0" ></iframe>
Seconf fichier (le javascript : listes déroulantes liées)
------------------------------------------------------------
<head>
<script>
function Choix(form) {
i = form.Rubrique.selectedIndex;
if (i == 0) {
return;
}
switch (i) {
case 1 : var txt = new Array ('Matériel','Poissons','Sécurité'); break;
case 2 : var txt = new Array ('Radioactivité','Information','Mesures'); break;
case 3 : var txt = new Array ('Philosophie','Psychologie','Humour'); break;
}
form.Rubrique.selectedIndex = 0;
for (i=0;i<3;i++) {
form.Page.options[i+1].text=txt[i];
}
}
</script>
</head>
<body>
<FORM>
<TABLE>
<TR>
<TH>Rubriques :</TH>
<TH>Pages :</TH>
</TR>
<TR>
<TD><SELECT NAME="Rubrique" onChange='Choix(this.form)'>
<OPTION>--- Choisissez une rubrique ---</OPTION>
<OPTION>Plongée</OPTION>
<OPTION>Nucléaire</OPTION>
<OPTION>Bonheur</OPTION>
</SELECT></TD>
<TD><SELECT NAME="Page">
<OPTION>--- Choisissez une page ---</OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
<OPTION></OPTION>
</SELECT></TD>
</TR>
</TABLE>
</FORM>
</body>
PROBLEME :
--------------
Il existe bien une liaison entre les deux listes mais le choix sélectionné dans la première liste ne reste pas affiché. Ce prog fonctionne si je n'utilise pas la fonction iframe.
Une soluce ?????
Merci d'avance
Golems
A voir également:
- IFRAME+JAVASCRIPT
- Telecharger javascript - Télécharger - Langages
- A javascript error occurred in the main process - Forum Handicap / Accessibilté
- A javascript error occurred in the main process - Forum Windows
- Www.youtube.com n'autorise pas la connexion. iframe - Forum YouTube
- Afficher un tableau javascript en html ✓ - Forum Javascript