Form se 2 selecty..
<form name="searchfilter" action="index.php?page=7" method="post" onSubmit="load();">
<table border="0" cellspacing="2" width="100%">
<tr>
<td>
<select name="stid" class="searchbox2" id="stid2" size="1" onchange='loadChildBox()'>
<option value="">Vsechno</option>
<option value="6">Banskobystricky</option>
<option value="1">Bratislavsky</option>
<option value="7">Presovsky</option>
<option value="3">Trenciansky</option>
<option value="5">Zilinsky</option>
</select>
</td>
</tr>
<tr>
<td>
<select name="locid" class="searchbox2" id="locid2" size="1">
</select>
</td>
</tr>
<tr>
</table>
</from>
A JS, ktery naplnuje automaticky druhy select, podle vyberu v prvnim
var comboBoxChildValues = new Array();
comboBoxChildValues[""] = new Array("Všetky lokality");
comboBoxChildValues["6"] = new Array(
"Všetky lokality",
"Krupina");
comboBoxChildValues["1"] = new Array(
"Všetky lokality",
"Bratislava - Staré mìsto");
comboBoxChildValues["7"] = new Array(
"Všetky lokality",
"Prešov");
comboBoxChildValues["3"] = new Array(
"Všetky lokality",
"Ilava",
"Trenèín",
"Púchov");
comboBoxChildValues["5"] = new Array(
"Všetky lokality",
"Bytèa",
"Èadca",
"Dolný Kubín",
"Kysucké Nové Mìsto",
"Liptovský Mikuláš",
"Martin",
"Žilina");
/* Main function */
function loadChildBox() {
var stid = document.getElementById('stid2');
var locid = document.getElementById('locid2');
var selectedIndex = stid.selectedIndex;
var selectedValue = stid.options[selectedIndex].value;
locid.options.length = 0;
for(i = 0; i < comboBoxChildValues[selectedValue].length; i++) {
locid.options[i] = new Option(comboBoxChildValues[selectedValue][i], comboBoxChildValues[selectedValue][i]);
}
}
function load() {
var locid = document.getElementById('locid2');
var stid = document.getElementById('stid2');
var selectedIndex = stid.selectedIndex;
var selectedValue = stid.options[selectedIndex].value;
var aktualni = document.getElementById('locid2').selectedIndex;
var fromCookie = document.cookie;
var rozdeleny = fromCookie.split('+');
locid.options.length = 0;
for(i = 0; i < comboBoxChildValues[selectedValue].length; i++) {
if ((selectedValue == rozdeleny[0]) && (i == rozdeleny[1]))
{
locid.options[i] = new Option(comboBoxChildValues[selectedValue][i], comboBoxChildValues[selectedValue][i]);
locid.options[i].selected = true;
locid.options[i].focus();
} else {
locid.options[i] = new Option(comboBoxChildValues[selectedValue][i], comboBoxChildValues[selectedValue][i]);
locid.options[i].focus();
}
}
// selectedValue => cislo kraje
// aktualni => cislo okresu
var text = selectedValue;
text += "+";
text += aktualni;
document.cookie = text;
}
A ja po odeslani formulare potrebuju na dalsi strance pracovat s $locid