• Home
  • Forum
  • Fare Web
  • Javascript

Problema con 2 funzioni:array,select dinamica

  • Creatore Discussione Creatore Discussione syrmos
  • Data di inizio Data di inizio 13 Feb 2013
Prec.
  • 1
  • 2
Primo Prec. 2 di 2
S

syrmos

Nuovo Utente
7 Feb 2012
28
0
0
  • 19 Mar 2013
  • #21
Grazie,ma niente...la tabella non appare.......

Questa è la funzione con l'aggiunta che mi hai suggerito
Codice:
function aggiornaOpzioni(scelta){
        var sel = document.getElementById("metodall");
        scelte = new Array();
		switch(scelta) {
            case '1':                
                scelte[0]= "Test di Harre";         		
				scelte[1]= "Metodo Bulgaro";
              	break;
     		case '2':                
                scelte[0] = "LIGHT TO HEAVY SYSTEM";
                scelte[1] = "HEAVY TO LIGHT SYSTEM";
                break;
            default:
                break;
        }         
        // azzero le option            
        sel.options.length = 1;
        // creo le option in base agli elementi degli array
        for(var i=0; i<scelte.length; i++) {                
            sel.options[sel.options.length]= new Option(scelte[i],scelte[i]); 
     					}
if (scelta == "Test di Harre")
     document.getElementById("Harre").style.display="inline";	
			}

Questo è il codice html delle due select
<div id="i1">
<form name="sommare">
Queste sono le 2 select:
Codice:
SCEGLI OBBIETTIVO
<select name="obbiet" size ="1" onchange="aggiornaOpzioni(this.options[this.selectedIndex].value);">
<option selected></option>
<option value="1">Forza</option>
<option value="2">Massa</option>
</select>

SCEGLI METODO ALLENAMENTO
<select id="metodall" name= "metododall" size ="1" onchange= "aggiornaOpzioni();">
<option selected></option>
</select>&nbsp;&nbsp;&nbsp;&nbsp;
 </div>
</form>

Questo è il codice html delle 2 tabelle:

Codice:
<div id="Bulgaro">
<form name="sommare">
<table border="1">
    <tr>
       METODO BULGARO
   </tr>
    <tr>
      <td><label class="Bulgaro">%DEL MAX</label></td>
      <td>RIPETIZIONI</td>
      <td>SERIE</td>
      <td>VELOCITA'</td>  
   </tr>
     <tr>
<td><input type="text"  size="4" class="corpo" name="Massimale()" disabled="disabled" readonly="readonly" id="w"></td>
   <td>1-4</td>
   <td>1</td>
   <td>MODERATA</td>
   </tr>
   <tr>
<td><input type="text"  size="4" class="corpo" name="Massimale()" disabled="disabled" readonly="readonly" id="y"></td>
   <td>4-8</td>
   <td>1</td>
   <td>MASSIMA</td>
   </tr>
</table>
</div>	


<div id="Harre">
<table border="1">
    <tr>
       TEST DI HARRE
   </tr>
    <tr>
      <td><label class="HARRE">%1 RM</label></td>
      <td>RIPETIZIONI</td>
      <td>VELOCITA'</td>
      <td>RECUPERO</td>  
      <td>SPECIFICITA'</td>    
   </tr>
     <tr>
<td><input type="text"  size="4" class="corpo" name="Massimale()" disabled="disabled" readonly="readonly" id="z7"></td>
   <td>1-5</td>
   <td>BASSA</td>
   <td>3-5'</td>
   <td>FORZA MASSIMALE</td>
   </tr>
   <tr>
<td><input type="text"  size="4" class="corpo" name="Massimale()" disabled="disabled" readonly="readonly" id="z8"></td>
   <td>5-10</td>
   <td>BASSA</td>
   <td>2-4'</td>
    <td>FORZA MAX IPERTROFIA</td>
   </tr>
   <tr>
<td><input type="text"  size="4" class="corpo" name="Massimale()" disabled="disabled" readonly="readonly" id="z9"></td>
   <td>6-10</td>
   <td>MASSIMA</td>
   <td>4-6'</td>
    <td>FORZA VELOCE</td>
   </tr>
     <tr>
<td><input type="text"  size="4" class="corpo" name="Massimale()" disabled="disabled" readonly="readonly" id="z10"></td>
   <td>20-30</td>
   <td>BASSA</td>
   <td>35-40''</td>
    <td>FORZA RESISTENTE</td>
   </tr>
   <tr>
<td><input type="text"  size="4" class="corpo" name="Massimale()" disabled="disabled" readonly="readonly" id="z11"></td>
   <td>25-30</td>
   <td>MODERATA</td>
   <td>OTTIMALE</td>
    <td>FORZA RESISTENTE</td>
   </tr>
   </table>
</div>

Quessto è il codice css

Codice:
#Harre
{
z-index:3;
padding:1em;
line-height: 20pt;
border:1px solid black;
display:none;
padding-top: 2px;
padding-bottom: 5px;
position: absolute;
top: 200px;
left: 445px;
background-color: #00BFFF;
color: black;
}

Per favore, dov'è che sto sbagliando??

Grazie
 

criric

Super Moderatore
Membro dello Staff
SUPER MOD
MOD
21 Ago 2010
5.606
54
48
TN
  • 20 Mar 2013
  • #22
devi crearti un altra funzione
Codice:
function mostratabella(scelta) {
        if (scelta == "Test di Harre")
            document.getElementById("Harre").style.display="inline";
    }
e passargli la scelta dal onchange sulla select
HTML:
<select id="metodall" name="metododall" onchange="mostratabella(this.options[this.selectedIndex].value);">
 
Ultima modifica: 20 Mar 2013
Prec.
  • 1
  • 2
Primo Prec. 2 di 2
Devi accedere o registrarti per poter rispondere.

Discussioni simili

V
problema con funzioni annidate
  • valerio matrix
  • 24 Mar 2016
  • Javascript
Risposte
2
Visite
2K
Javascript 24 Mar 2016
valerio matrix
V
S
Problema con le funzioni
  • Salvo Salvi
  • 18 Lug 2013
  • PHP
Risposte
6
Visite
1K
PHP 18 Lug 2013
borgo italia
M
Problema con le funzioni in php-gtk
  • merka
  • 5 Gen 2010
  • PHP
Risposte
0
Visite
1K
PHP 5 Gen 2010
merka
M
A
Problema con le funzioni
  • antolot
  • 22 Nov 2007
  • PHP
Risposte
4
Visite
1K
PHP 27 Nov 2007
antolot
A
Problema in Shopify con Pixel Facebook
  • voldemort
  • 27 Mag 2024
  • E-Commerce
Risposte
1
Visite
2K
E-Commerce 27 Mag 2024
m.pittini
M
O
problema con dvr dahua xvr5116
  • oky74
  • 11 Mar 2023
  • IP Cam e Videosorveglianza
Risposte
0
Visite
2K
IP Cam e Videosorveglianza 11 Mar 2023
oky74
O
G
Problema con Xampp
  • GreatOtaku
  • 5 Mar 2023
  • Web Server
Risposte
1
Visite
1K
Web Server 6 Mar 2023
GreatOtaku
G
Problema con miniature comandi
  • andrea barletta
  • 27 Feb 2023
  • Photoshop
Risposte
0
Visite
1K
Photoshop 27 Feb 2023
andrea barletta
I
problema con alice
  • ilprincipiante
  • 10 Feb 2023
  • Posta Elettronica
Risposte
0
Visite
1K
Posta Elettronica 10 Feb 2023
ilprincipiante
I
N
Problema con position absolute e overflow
  • Nocciolina
  • 23 Gen 2023
  • HTML e CSS
Risposte
4
Visite
1K
HTML e CSS 31 Gen 2023
Nocciolina
N
L
Problema con inner join
  • lupentino
  • 23 Nov 2022
  • PHP
Risposte
11
Visite
2K
PHP 27 Nov 2022
marino51
K
[php] Problema con inner join
  • Kiko74b
  • 22 Nov 2022
  • PHP
Risposte
4
Visite
2K
PHP 23 Nov 2022
Kiko74b
K
K
[PHP] Problema con variabili concatenate.
  • Kiko74b
  • 17 Ott 2022
  • PHP
Risposte
1
Visite
1K
PHP 30 Ott 2022
thanatos
T
O
  • Bloccata
problema con query
  • Odino7009
  • 23 Mag 2022
  • PHP
Risposte
4
Visite
2K
PHP 24 Mag 2022
Odino7009
O
I
problema con 2 account
  • ilprincipiante
  • 11 Mar 2022
  • Posta Elettronica
Risposte
1
Visite
2K
Posta Elettronica 11 Mar 2022
WmbertSea
L
problema collegamento file css con html
  • leonardo20
  • 2 Mar 2022
  • HTML e CSS
Risposte
1
Visite
2K
HTML e CSS 3 Ott 2023
WEBLEADERS
W
E
Problema accesso a file con app sviluppata con MIT APP INVENTOR 2
  • emanuelespinelli
  • 22 Dic 2021
  • Sviluppo app per Android
Risposte
0
Visite
3K
Sviluppo app per Android 22 Dic 2021
emanuelespinelli
E
M
Problema con Try Catch
  • migo80
  • 10 Ott 2021
  • PHP
Risposte
0
Visite
2K
PHP 10 Ott 2021
migo80
M
Problema con gli eventi del mouse su una data table:
  • Sergio Unia
  • 7 Ago 2021
  • Javascript
Risposte
2
Visite
2K
Javascript 7 Ago 2021
Sergio Unia
T
PROBLEMA CON SESSIONI
  • thanatos
  • 13 Lug 2021
  • PHP
Risposte
3
Visite
2K
PHP 14 Lug 2021
thanatos
T
Condividi:
Facebook X (Twitter) LinkedIn WhatsApp e-mail Condividi Link
  • Home
  • Forum
  • Fare Web
  • Javascript
  • Italiano
  • Termini e condizioni d'uso del sito
  • Policy Privacy
  • Aiuto
  • Home
Community platform by XenForo® © 2010-2024 XenForo Ltd. | Traduzione a cura di XenForo Italia
Menu
Accedi

Registrati

  • Home
  • Forum
    • Nuovi Messaggi
    • Cerca...
  • Novità
    • Featured content
    • Nuovi Messaggi
    • Ultime Attività
X

Privacy & Transparency

We use cookies and similar technologies for the following purposes:

  • Personalized ads and content
  • Content measurement and audience insights

Do you accept cookies and these technologies?

X

Privacy & Transparency

We use cookies and similar technologies for the following purposes:

  • Personalized ads and content
  • Content measurement and audience insights

Do you accept cookies and these technologies?