combobox regione provincia referenziate

Nell’articolo ComboBox pronte all’uso: select nazioni, regioni e province ho condiviso l’HTML delle combobox di nazione, regione e provincia per offrirti un comodo copia-incolla.

Oggi condivido l’HTML e una funzione JavaScript che ti permetterà di implementare le combo regione e provincia “referenziate“. In pratica, selezionando una regione nella prima combobox, verranno poi caricate le rispettive province nella seconda.

Combo regioni

<select id="regione" name="regione" onchange="javascript:loadProvincia(this.value);">
<option value="" selected>Seleziona</option>
<option value="abruzzo">abruzzo</option>
<option value="basilicata">basilicata</option>
<option value="calabria">calabria</option>
<option value="campania">campania</option>
<option value="emilia romagna">emilia romagna</option>
<option value="friuli venezia giulia">friuli venezia giulia</option>
<option value="lazio">lazio</option>
<option value="liguria">liguria</option>
<option value="lombardia">lombardia</option>
<option value="marche">marche</option>
<option value="molise">molise</option>
<option value="piemonte">piemonte</option>
<option value="puglia">puglia</option>
<option value="sardegna">sardegna</option>
<option value="sicilia">sicilia</option>
<option value="toscana">toscana</option>
<option value="trentino alto adige">trentino alto adige</option>
<option value="umbria">umbria</option>
<option value="valle d'aosta">valle d'aosta</option>
<option value="veneto">veneto</option>
</select>

Combo province

<select id="provincia" name="provincia">
<option value="" selected>Seleziona</option>
 </select>

Combo regioni (edit version)

<select id="regione" name="regione" onchange="javascript:loadProvincia(this.value);">
<option value="" <?php if ($regione=="") echo "selected"; ?> >Seleziona</option>
<option value="abruzzo" <?php if ($regione=="abruzzo") echo "selected"; ?> >abruzzo</option>
<option value="basilicata" <?php if ($regione=="basilicata") echo "selected"; ?> >basilicata</option>
<option value="calabria" <?php if ($regione=="calabria") echo "selected"; ?> >calabria</option>
<option value="campania" <?php if ($regione=="campania") echo "selected"; ?> >campania</option>
<option value="emilia romagna" <?php if ($regione=="emilia romagna") echo "selected"; ?> >emilia romagna</option>
<option value="friuli venezia giulia" <?php if ($regione=="friuli venezia giulia") echo "selected"; ?> >friuli venezia giulia</option>
<option value="lazio" <?php if ($regione=="lazio") echo "selected"; ?> >lazio</option>
<option value="liguria" <?php if ($regione=="liguria") echo "selected"; ?> >liguria</option>
<option value="lombardia" <?php if ($regione=="lombardia") echo "selected"; ?> >lombardia</option>
<option value="marche" <?php if ($regione=="marche") echo "selected"; ?> >marche</option>
<option value="molise" <?php if ($regione=="molise") echo "selected"; ?> >molise</option>
<option value="piemonte" <?php if ($regione=="piemonte") echo "selected"; ?> >piemonte</option>
<option value="puglia" <?php if ($regione=="puglia") echo "selected"; ?> >puglia</option>
<option value="sardegna" <?php if ($regione=="sardegna") echo "selected"; ?> >sardegna</option>
<option value="sicilia" <?php if ($regione=="sicilia") echo "selected"; ?> >sicilia</option>
<option value="toscana" <?php if ($regione=="toscana") echo "selected"; ?> >toscana</option>
<option value="trentino alto adige" <?php if ($regione=="trentino alto adige") echo "selected"; ?> >trentino alto adige</option>
<option value="umbria" <?php if ($regione=="umbria") echo "selected"; ?> >umbria</option>
<option value="valle d'aosta" <?php if ($regione=="valle d'aosta") echo "selected"; ?> >valle d'aosta</option>
<option value="veneto" <?php if ($regione=="veneto") echo "selected"; ?> >veneto</option>
</select>

Combo province (edit version)

<select id="provincia" name="provincia">
<option value="" <?php if ($provincia=="") echo "selected"; ?> >Seleziona</option>
<option value="Agrigento" <?php if ($provincia=="Agrigento") echo "selected"; ?> >Agrigento</option>
<option value="Alessandria" <?php if ($provincia=="Alessandria") echo "selected"; ?> >Alessandria</option>
<option value="Ancona" <?php if ($provincia=="Ancona") echo "selected"; ?> >Ancona</option>
<option value="Aosta" <?php if ($provincia=="Aosta") echo "selected"; ?> >Aosta</option>
<option value="Arezzo" <?php if ($provincia=="Arezzo") echo "selected"; ?> >Arezzo</option>
<option value="Ascoli Piceno" <?php if ($provincia=="Ascoli Piceno") echo "selected"; ?> >Ascoli Piceno</option>
<option value="Asti" <?php if ($provincia=="Asti") echo "selected"; ?> >Asti</option>
<option value="Avellino" <?php if ($provincia=="Avellino") echo "selected"; ?> >Avellino</option>
<option value="Bari" <?php if ($provincia=="Bari") echo "selected"; ?> >Bari</option>
<option value="Barletta-Andria-Trani" <?php if ($provincia=="Barletta-Andria-Trani") echo "selected"; ?> >Barletta-Andria-Trani</option>
<option value="Belluno" <?php if ($provincia=="Belluno") echo "selected"; ?> >Belluno</option>
<option value="Benevento" <?php if ($provincia=="Benevento") echo "selected"; ?> >Benevento</option>
<option value="Bergamo" <?php if ($provincia=="Bergamo") echo "selected"; ?> >Bergamo</option>
<option value="Biella" <?php if ($provincia=="Biella") echo "selected"; ?> >Biella</option>
<option value="Bologna" <?php if ($provincia=="Bologna") echo "selected"; ?> >Bologna</option>
<option value="Bolzano" <?php if ($provincia=="Bolzano") echo "selected"; ?> >Bolzano</option>
<option value="Brescia" <?php if ($provincia=="Brescia") echo "selected"; ?> >Brescia</option>
<option value="Brindisi" <?php if ($provincia=="Brindisi") echo "selected"; ?> >Brindisi</option>
<option value="Cagliari" <?php if ($provincia=="Cagliari") echo "selected"; ?> >Cagliari</option>
<option value="Caltanissetta" <?php if ($provincia=="Caltanissetta") echo "selected"; ?> >Caltanissetta</option>
<option value="Caserta" <?php if ($provincia=="Caserta") echo "selected"; ?> >Caserta</option>
<option value="Catania" <?php if ($provincia=="Catania") echo "selected"; ?> >Catania</option>
<option value="Catanzaro" <?php if ($provincia=="Catanzaro") echo "selected"; ?> >Catanzaro</option>
<option value="Chieti" <?php if ($provincia=="Chieti") echo "selected"; ?> >Chieti</option>
<option value="Como" <?php if ($provincia=="Como") echo "selected"; ?> >Como</option>
<option value="Cosenza" <?php if ($provincia=="Cosenza") echo "selected"; ?> >Cosenza</option>
<option value="Cremona" <?php if ($provincia=="Cremona") echo "selected"; ?> >Cremona</option>
<option value="Crotone" <?php if ($provincia=="Crotone") echo "selected"; ?> >Crotone</option>
<option value="Cuneo" <?php if ($provincia=="Cuneo") echo "selected"; ?> >Cuneo</option>
<option value="Enna" <?php if ($provincia=="Enna") echo "selected"; ?> >Enna</option>
<option value="Ferrara" <?php if ($provincia=="Ferrara") echo "selected"; ?> >Ferrara</option>
<option value="Firenze" <?php if ($provincia=="Firenze") echo "selected"; ?> >Firenze</option>
<option value="Foggia" <?php if ($provincia=="Foggia") echo "selected"; ?> >Foggia</option>
<option value="Forl&igrave;-Cesena" <?php if ($provincia=="Forl&igrave;-Cesena") echo "selected"; ?> >Forl&igrave;-Cesena</option>
<option value="Frosinone" <?php if ($provincia=="Frosinone") echo "selected"; ?> >Frosinone</option>
<option value="Genova" <?php if ($provincia=="Genova") echo "selected"; ?> >Genova</option>
<option value="Gorizia" <?php if ($provincia=="Gorizia") echo "selected"; ?> >Gorizia</option>
<option value="Grosseto" <?php if ($provincia=="Grosseto") echo "selected"; ?> >Grosseto</option>
<option value="Imperia" <?php if ($provincia=="Imperia") echo "selected"; ?> >Imperia</option>
<option value="L\'Aquila" <?php if ($provincia=="L\'Aquila") echo "selected"; ?> >L\'Aquila</option>
<option value="La Spezia" <?php if ($provincia=="La Spezia") echo "selected"; ?> >La Spezia</option>
<option value="Latina" <?php if ($provincia=="Latina") echo "selected"; ?> >Latina</option>
<option value="Lecce" <?php if ($provincia=="Lecce") echo "selected"; ?> >Lecce</option>
<option value="Lecco" <?php if ($provincia=="Lecco") echo "selected"; ?> >Lecco</option>
<option value="Livorno" <?php if ($provincia=="Livorno") echo "selected"; ?> >Livorno</option>
<option value="Lodi" <?php if ($provincia=="Lodi") echo "selected"; ?> >Lodi</option>
<option value="Lucca" <?php if ($provincia=="Lucca") echo "selected"; ?> >Lucca</option>
<option value="Macerata" <?php if ($provincia=="Macerata") echo "selected"; ?> >Macerata</option>
<option value="Mantova" <?php if ($provincia=="Mantova") echo "selected"; ?> >Mantova</option>
<option value="Massa Carrara" <?php if ($provincia=="Massa Carrara") echo "selected"; ?> >Massa Carrara</option>
<option value="Matera" <?php if ($provincia=="Matera") echo "selected"; ?> >Matera</option>
<option value="Messina" <?php if ($provincia=="Messina") echo "selected"; ?> >Messina</option>
<option value="Milano" <?php if ($provincia=="Milano") echo "selected"; ?> >Milano</option>
<option value="Modena" <?php if ($provincia=="Modena") echo "selected"; ?> >Modena</option>
<option value="Monza Brianza" <?php if ($provincia=="Monza Brianza") echo "selected"; ?> >Monza Brianza</option>
<option value="Napoli" <?php if ($provincia=="Napoli") echo "selected"; ?> >Napoli</option>
<option value="Novara" <?php if ($provincia=="Novara") echo "selected"; ?> >Novara</option>
<option value="Nuoro" <?php if ($provincia=="Nuoro") echo "selected"; ?> >Nuoro</option>
<option value="Olbia-Tempio" <?php if ($provincia=="Olbia-Tempio") echo "selected"; ?> >Olbia-Tempio</option>
<option value="Oristano" <?php if ($provincia=="Oristano") echo "selected"; ?> >Oristano</option>
<option value="Padova" <?php if ($provincia=="Padova") echo "selected"; ?> >Padova</option>
<option value="Palermo" <?php if ($provincia=="Palermo") echo "selected"; ?> >Palermo</option>
<option value="Parma" <?php if ($provincia=="Parma") echo "selected"; ?> >Parma</option>
<option value="Pavia" <?php if ($provincia=="Pavia") echo "selected"; ?> >Pavia</option>
<option value="Perugia" <?php if ($provincia=="Perugia") echo "selected"; ?> >Perugia</option>
<option value="Pesaro e Urbino" <?php if ($provincia=="Pesaro e Urbino") echo "selected"; ?> >Pesaro e Urbino</option>
<option value="Pescara" <?php if ($provincia=="Pescara") echo "selected"; ?> >Pescara</option>
<option value="Piacenza" <?php if ($provincia=="Piacenza") echo "selected"; ?> >Piacenza</option>
<option value="Pisa" <?php if ($provincia=="Pisa") echo "selected"; ?> >Pisa</option>
<option value="Pistoia" <?php if ($provincia=="Pistoia") echo "selected"; ?> >Pistoia</option>
<option value="Pordenone" <?php if ($provincia=="Pordenone") echo "selected"; ?> >Pordenone</option>
<option value="Potenza" <?php if ($provincia=="Potenza") echo "selected"; ?> >Potenza</option>
<option value="Prato" <?php if ($provincia=="Prato") echo "selected"; ?> >Prato</option>
<option value="Ragusa" <?php if ($provincia=="Ragusa") echo "selected"; ?> >Ragusa</option>
<option value="Ravenna" <?php if ($provincia=="Ravenna") echo "selected"; ?> >Ravenna</option>
<option value="Reggio Calabria" <?php if ($provincia=="Reggio Calabria") echo "selected"; ?> >Reggio Calabria</option>
<option value="Repubblica di San Marino" <?php if ($provincia=="Repubblica di San Marino") echo "selected"; ?> >Repubblica di San Marino</option>
<option value="Rieti" <?php if ($provincia=="Rieti") echo "selected"; ?> >Rieti</option>
<option value="Rimini" <?php if ($provincia=="Rimini") echo "selected"; ?> >Rimini</option>
<option value="Roma" <?php if ($provincia=="Roma") echo "selected"; ?> >Roma</option>
<option value="Rovigo" <?php if ($provincia=="Rovigo") echo "selected"; ?> >Rovigo</option>
<option value="Salerno" <?php if ($provincia=="Salerno") echo "selected"; ?> >Salerno</option>
<option value="Sassari" <?php if ($provincia=="Sassari") echo "selected"; ?> >Sassari</option>
<option value="Savona" <?php if ($provincia=="Savona") echo "selected"; ?> >Savona</option>
<option value="Siena" <?php if ($provincia=="Siena") echo "selected"; ?> >Siena</option>
<option value="Siracusa" <?php if ($provincia=="Siracusa") echo "selected"; ?> >Siracusa</option>
<option value="Sondrio" <?php if ($provincia=="Sondrio") echo "selected"; ?> >Sondrio</option>
<option value="Taranto" <?php if ($provincia=="Taranto") echo "selected"; ?> >Taranto</option>
<option value="Teramo" <?php if ($provincia=="Teramo") echo "selected"; ?> >Teramo</option>
<option value="Terni" <?php if ($provincia=="Terni") echo "selected"; ?> >Terni</option>
<option value="Torino" <?php if ($provincia=="Torino") echo "selected"; ?> >Torino</option>
<option value="Trapani" <?php if ($provincia=="Trapani") echo "selected"; ?> >Trapani</option>
<option value="Trento" <?php if ($provincia=="Trento") echo "selected"; ?> >Trento</option>
<option value="Treviso" <?php if ($provincia=="Treviso") echo "selected"; ?> >Treviso</option>
<option value="Trieste" <?php if ($provincia=="Trieste") echo "selected"; ?> >Trieste</option>
<option value="Udine" <?php if ($provincia=="Udine") echo "selected"; ?> >Udine</option>
<option value="Varese" <?php if ($provincia=="Varese") echo "selected"; ?> >Varese</option>
<option value="Venezia" <?php if ($provincia=="Venezia") echo "selected"; ?> >Venezia</option>
<option value="Verb-Cus-Ossola" <?php if ($provincia=="Verb-Cus-Ossola") echo "selected"; ?> >Verb-Cus-Ossola</option>
<option value="Vercelli" <?php if ($provincia=="Vercelli") echo "selected"; ?> >Vercelli</option>
<option value="Verona" <?php if ($provincia=="Verona") echo "selected"; ?> >Verona</option>
<option value="Vibo Valentia" <?php if ($provincia=="Vibo Valentia") echo "selected"; ?> >Vibo Valentia</option>
<option value="Vicenza" <?php if ($provincia=="Vicenza") echo "selected"; ?> >Vicenza</option>
<option value="Viterbo" <?php if ($provincia=="Viterbo") echo "selected"; ?> >Viterbo</option>           
</select>

Ed ecco la funzione JavaScript

function loadProvincia(param) {
 
var str = "";
 
    if (param=="") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Agrigento">Agrigento</option>';
        str += '<option value="Alessandria">Alessandria</option>';
        str += '<option value="Ancona">Ancona</option>';
        str += '<option value="Aosta">Aosta</option>';
        str += '<option value="Arezzo">Arezzo</option>';
        str += '<option value="Ascoli Piceno">Ascoli Piceno</option>';
        str += '<option value="Asti">Asti</option>';
        str += '<option value="Avellino">Avellino</option>';
        str += '<option value="Bari">Bari</option>';
        str += '<option value="Barletta-Andria-Trani">Barletta-Andria-Trani</option>';
        str += '<option value="Belluno">Belluno</option>';
        str += '<option value="Benevento">Benevento</option>';
        str += '<option value="Bergamo">Bergamo</option>';
        str += '<option value="Biella">Biella</option>';
        str += '<option value="Bologna">Bologna</option>';
        str += '<option value="Bolzano">Bolzano</option>';
        str += '<option value="Brescia">Brescia</option>';
        str += '<option value="Brindisi">Brindisi</option>';
        str += '<option value="Cagliari">Cagliari</option>';
        str += '<option value="Caltanissetta">Caltanissetta</option>';
        str += '<option value="Caserta">Caserta</option>';
        str += '<option value="Catania">Catania</option>';
        str += '<option value="Catanzaro">Catanzaro</option>';
        str += '<option value="Chieti">Chieti</option>';
        str += '<option value="Como">Como</option>';
        str += '<option value="Cosenza">Cosenza</option>';
        str += '<option value="Cremona">Cremona</option>';
        str += '<option value="Crotone">Crotone</option>';
        str += '<option value="Cuneo">Cuneo</option>';
        str += '<option value="Enna">Enna</option>';
        str += '<option value="Ferrara">Ferrara</option>';
        str += '<option value="Firenze">Firenze</option>';
        str += '<option value="Foggia">Foggia</option>';
        str += '<option value="Forl&igrave;-Cesena">Forl&igrave;-Cesena</option>';
        str += '<option value="Frosinone">Frosinone</option>';
        str += '<option value="Genova">Genova</option>';
        str += '<option value="Gorizia">Gorizia</option>';
        str += '<option value="Grosseto">Grosseto</option>';
        str += '<option value="Imperia">Imperia</option>';
        str += '<option value="L\'Aquila">L\'Aquila</option>';
        str += '<option value="La Spezia">La Spezia</option>';
        str += '<option value="Latina">Latina</option>';
        str += '<option value="Lecce">Lecce</option>';
        str += '<option value="Lecco">Lecco</option>';
        str += '<option value="Livorno">Livorno</option>';
        str += '<option value="Lodi">Lodi</option>';
        str += '<option value="Lucca">Lucca</option>';
        str += '<option value="Macerata">Macerata</option>';
        str += '<option value="Mantova">Mantova</option>';
        str += '<option value="Massa Carrara">Massa Carrara</option>';
        str += '<option value="Matera">Matera</option>';
        str += '<option value="Messina">Messina</option>';
        str += '<option value="Milano">Milano</option>';
        str += '<option value="Modena">Modena</option>';
        str += '<option value="Monza Brianza">Monza Brianza</option>';
        str += '<option value="Napoli">Napoli</option>';
        str += '<option value="Novara">Novara</option>';
        str += '<option value="Nuoro">Nuoro</option>';
        str += '<option value="Olbia-Tempio">Olbia-Tempio</option>';
        str += '<option value="Oristano">Oristano</option>';
        str += '<option value="Padova">Padova</option>';
        str += '<option value="Palermo">Palermo</option>';
        str += '<option value="Parma">Parma</option>';
        str += '<option value="Pavia">Pavia</option>';
        str += '<option value="Perugia">Perugia</option>';
        str += '<option value="Pesaro e Urbino">Pesaro e Urbino</option>';
        str += '<option value="Pescara">Pescara</option>';
        str += '<option value="Piacenza">Piacenza</option>';
        str += '<option value="Pisa">Pisa</option>';
        str += '<option value="Pistoia">Pistoia</option>';
        str += '<option value="Pordenone">Pordenone</option>';
        str += '<option value="Potenza">Potenza</option>';
        str += '<option value="Prato">Prato</option>';
        str += '<option value="Ragusa">Ragusa</option>';
        str += '<option value="Ravenna">Ravenna</option>';
        str += '<option value="Reggio Calabria">Reggio Calabria</option>';
        str += '<option value="Repubblica di San Marino">Repubblica di San Marino</option>';
        str += '<option value="Rieti">Rieti</option>';
        str += '<option value="Rimini">Rimini</option>';
        str += '<option value="Roma">Roma</option>';
        str += '<option value="Rovigo">Rovigo</option>';
        str += '<option value="Salerno">Salerno</option>';
        str += '<option value="Sassari">Sassari</option>';
        str += '<option value="Savona">Savona</option>';
        str += '<option value="Siena">Siena</option>';
        str += '<option value="Siracusa">Siracusa</option>';
        str += '<option value="Sondrio">Sondrio</option>';
        str += '<option value="Taranto">Taranto</option>';
        str += '<option value="Teramo">Teramo</option>';
        str += '<option value="Terni">Terni</option>';
        str += '<option value="Torino">Torino</option>';
        str += '<option value="Trapani">Trapani</option>';
        str += '<option value="Trento">Trento</option>';
        str += '<option value="Treviso">Treviso</option>';
        str += '<option value="Trieste">Trieste</option>';
        str += '<option value="Udine">Udine</option>';
        str += '<option value="Varese">Varese</option>';
        str += '<option value="Venezia">Venezia</option>';
        str += '<option value="Verb-Cus-Ossola">Verb-Cus-Ossola</option>';
        str += '<option value="Vercelli">Vercelli</option>';
        str += '<option value="Verona">Verona</option>';
        str += '<option value="Vibo Valentia">Vibo Valentia</option>';
        str += '<option value="Vicenza">Vicenza</option>';
        str += '<option value="Viterbo">Viterbo</option>';
 
    }
 
 
    if (param=="abruzzo") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Chieti">Chieti</option>';
        str += '<option value="L\'Aquila">L\'Aquila</option>';
        str += '<option value="Pescara">Pescara</option>';
        str += '<option value="Teramo">Teramo</option>';
 
    }
 
 
 
    if (param=="basilicata") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Matera">Matera</option>';
        str += '<option value="Potenza">Potenza</option>';
 
    }
 
 
 
    if (param=="calabria") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Catanzaro">Catanzaro</option>';
        str += '<option value="Cosenza">Cosenza</option>';
        str += '<option value="Crotone">Crotone</option>';
        str += '<option value="Reggio Calabria">Reggio Calabria</option>';
        str += '<option value="Vibo Valentia">Vibo Valentia</option>';
 
    }
 
 
 
 
    if (param=="campania") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Avellino">Avellino</option>';
        str += '<option value="Benevento">Benevento</option>';
        str += '<option value="Caserta">Caserta</option>';
        str += '<option value="Napoli">Napoli</option>';
        str += '<option value="Salerno">Salerno</option>';
 
    }
 
 
 
 
    if (param=="emilia romagna") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Bologna">Bologna</option>';
        str += '<option value="Ferrara">Ferrara</option>';
        str += '<option value="Forl&igrave;-Cesena">Forl&igrave;-Cesena</option>';
        str += '<option value="Modena">Modena</option>';
        str += '<option value="Parma">Parma</option>';
        str += '<option value="Piacenza">Piacenza</option>';
        str += '<option value="Ravenna">Ravenna</option>';
        str += '<option value="Repubblica di San Marino">Repubblica di San Marino</option>';
        str += '<option value="Rimini">Rimini</option>';
 
    }
 
 
 
 
    if (param=="friuli venezia giulia") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Gorizia">Gorizia</option>';
        str += '<option value="Pordenone">Pordenone</option>';
        str += '<option value="Trieste">Trieste</option>';
        str += '<option value="Udine">Udine</option>';
 
    }
 
 
 
 
    if (param=="lazio") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Frosinone">Frosinone</option>';
        str += '<option value="Latina">Latina</option>';
        str += '<option value="Rieti">Rieti</option>';
        str += '<option value="Roma">Roma</option>';
        str += '<option value="Viterbo">Viterbo</option>';
 
    }
 
 
 
 
 
    if (param=="liguria") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Genova">Genova</option>';
        str += '<option value="Imperia">Imperia</option>';
        str += '<option value="La Spezia">La Spezia</option>';
        str += '<option value="Savona">Savona</option>';
 
    }
 
 
 
 
    if (param=="lombardia") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Bergamo">Bergamo</option>';
        str += '<option value="Brescia">Brescia</option>';
        str += '<option value="Como">Como</option>';
        str += '<option value="Cremona">Cremona</option>';
        str += '<option value="Lecco">Lecco</option>';
        str += '<option value="Lodi">Lodi</option>';
        str += '<option value="Mantova">Mantova</option>';
        str += '<option value="Milano">Milano</option>';
        str += '<option value="Monza Brianza">Monza Brianza</option>';
        str += '<option value="Pavia">Pavia</option>';
        str += '<option value="Sondrio">Sondrio</option>';
        str += '<option value="Varese">Varese</option>';
 
    }
 
 
 
 
    if (param=="marche") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Ancona">Ancona</option>';
        str += '<option value="Ascoli Piceno">Ascoli Piceno</option>';
        str += '<option value="Macerata">Macerata</option>';
        str += '<option value="Pesaro e Urbino">Pesaro e Urbino</option>';
 
    }
 
 
 
 
    if (param=="piemonte") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Alessandria">Alessandria</option>';
        str += '<option value="Asti">Asti</option>';
        str += '<option value="Biella">Biella</option>';
        str += '<option value="Cuneo">Cuneo</option>';
        str += '<option value="Novara">Novara</option>';
        str += '<option value="Torino">Torino</option>';
        str += '<option value="Verb-Cus-Ossola">Verb-Cus-Ossola</option>';
        str += '<option value="Vercelli">Vercelli</option>';
 
    }
 
 
 
 
    if (param=="puglia") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Bari">Bari</option>';
        str += '<option value="Barletta-Andria-Trani">Barletta-Andria-Trani</option>';
        str += '<option value="Brindisi">Brindisi</option>';
        str += '<option value="Foggia">Foggia</option>';
        str += '<option value="Lecce">Lecce</option>';
        str += '<option value="Taranto">Taranto</option>';
 
    }
 
 
 
 
 
    if (param=="sardegna") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Cagliari">Cagliari</option>';
        str += '<option value="Nuoro">Nuoro</option>';
        str += '<option value="Olbia-Tempio">Olbia-Tempio</option>';
        str += '<option value="Oristano">Oristano</option>';
        str += '<option value="Sassari">Sassari</option>';
 
    }
 
 
 
 
    if (param=="sicilia") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Agrigento">Agrigento</option>';
        str += '<option value="Caltanissetta">Caltanissetta</option>';
        str += '<option value="Catania">Catania</option>';
        str += '<option value="Enna">Enna</option>';
        str += '<option value="Messina">Messina</option>';
        str += '<option value="Palermo">Palermo</option>';
        str += '<option value="Ragusa">Ragusa</option>';
        str += '<option value="Siracusa">Siracusa</option>';
        str += '<option value="Trapani">Trapani</option>';
 
    }
 
 
 
 
    if (param=="toscana") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Arezzo">Arezzo</option>';
        str += '<option value="Firenze">Firenze</option>';
        str += '<option value="Grosseto">Grosseto</option>';
        str += '<option value="Livorno">Livorno</option>';
        str += '<option value="Lucca">Lucca</option>';
        str += '<option value="Massa Carrara">Massa Carrara</option>';
        str += '<option value="Pisa">Pisa</option>';
        str += '<option value="Pistoia">Pistoia</option>';
        str += '<option value="Prato">Prato</option>';
        str += '<option value="Siena">Siena</option>';
 
    }
 
 
 
 
    if (param=="trentino alto adige") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Bolzano">Bolzano</option>';
        str += '<option value="Trento">Trento</option>';
 
    }
 
 
 
 
    if (param=="umbria") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Perugia">Perugia</option>';
        str += '<option value="Terni">Terni</option>';
 
    }
 
 
 
    if (param=="valle d'aosta") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Aosta">Aosta</option>';
 
    }
 
 
 
 
    if (param=="veneto") {
 
        str += '<option value="" selected>Seleziona</option>';
        str += '<option value="Belluno">Belluno</option>';
        str += '<option value="Padova">Padova</option>';
        str += '<option value="Rovigo">Rovigo</option>';
        str += '<option value="Treviso">Treviso</option>';
        str += '<option value="Venezia">Venezia</option>';
        str += '<option value="Verona">Verona</option>';
        str += '<option value="Vicenza">Vicenza</option>';
 
    }
 
 
 
    $('#provincia').html(str);
 
}

NO SPAM. Non fornirò la tua email a terzi e riceverai solo contenuti che ti interessano sugli argomenti che tratto e potrai cancellarti quando vuoi con un link che trovi in tutte le email.