ciao a tutti avrei bisogno di creare una select che "tenga in memoria" l'ultima selezione e in base a quella cambi le altre... in più se una select viene variata, tutte quelle sotto di essa devono essere resettate al valore iniziale <option value="">-----------</option>...
il mio codice è il seguente:
<head>
<script language="JavaScript" type="text/javascript">
function tabidx(v_form, v_field)
{
if (document.general.TABIDX)
{
document.forms[v_form].elements[v_field].focus();
}
}
</script>
</head>
<form name="general">
<select class="testo" style="width:150px;"onChange="document.general.ACT ION.value='0'; javascript:document.forms.general.TABIDX.value = 'SELPRO'; Subm('general', '<? print $_SERVER['PHP_SELF'] ."?USRSID=". $GH_PARAMS['USRSID']; ?>', '');" name="SELPRO" tabindex="50">
<option value="">-----------</option>
<?
for ($gc_i = 0; $gc_i < count($GH_HLPINF); $gc_i++)
{
$gr_codpro = $GH_HLPINF[$gc_i]['CODPRO'];
$gr_prodes = $GH_HLPINF[$gc_i]['PRODES'];
if (isset($GH_PARAMS['SELPRO']) && ($GH_PARAMS['SELPRO'] == $gr_codpro))
print "<option value=\"$gr_codpro\" selected>$gr_prodes</option>\n";
else
print "<option value=\"$gr_codpro\">$gr_prodes</option>\n";
}
?>
</select>
<select class="testo" style="width:150px;" onChange="document.forms.general.ACTION.value='0'; document.forms.general.TABIDX.value = 'TIPPR1';<? if (isset($GH_PARAMS['TIPPR2']) && $GH_PARAMS['TIPPR2'] != "") print "document.forms.general.TIPPR2.selectedIndex = 1;"; if (isset($GH_PARAMS['TIPPR3']) && $GH_PARAMS['TIPPR3'] != "") print "document.forms.general.TIPPR3.selectedIndex = 1;"; if (isset($GH_PARAMS['TIPPR4']) && $GH_PARAMS['TIPPR4'] != "") print "document.forms.general.TIPPR4.selectedIndex = 1;"; if (isset($GH_PARAMS['TIPPR5']) && $GH_PARAMS['TIPPR5'] != "") print "document.forms.general.TIPPR5.selectedIndex = 1;"; ?>Subm('general', '<? print $_SERVER['PHP_SELF'] ."?USRSID=". $GH_PARAMS['USRSID']; ?>', '');" name="TIPPR1" tabindex="51">
<option value="">-----------</option>
<?
for ($gc_i = 0; $gc_i < count($ga_tippr1); $gc_i++)
{
$gr_tippr1 = $ga_tippr1[$gc_i]['TIPPR1'];
$gr_tipde1 = $ga_tippr1[$gc_i]['TIPDE1'];
if (isset($GH_PARAMS['TIPPR1']) && ($GH_PARAMS['TIPPR1'] == $gr_tippr1))
print "<option value=\"$gr_tippr1\" selected>$gr_tipde1</option>\n";
else
print "<option value=\"$gr_tippr1\">$gr_tipde1</option>\n";
}
?>
</select>
</form>
la seconda select non mi resetta le altre successive select(che per non essere prolisso non ho scritto).... aiutoooooooooooo![]()
mail: guido.meregalli@ttycreo.it