• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Select box mit Button auswählen...

3l3ctric

Neues Mitglied
Hey,

habe schon gegooglet aber keinerlei Hilfe gefunden...

ich habe folgendes Problem... hier erstmal der Script:
HTML:
<select>
   <option value="null.html">0....</option>
   <option value="eins.html">1....</option>
   <option value="zwei.html">2....</option>
   <option value="drei.html">3....</option>
   <option value="vier.html">4....</option>
   <option value="fünf.html">5....</option>
   <option value="sechs.html">6....</option>
   <option value="sieben.html">7....</option>
   <option value="acht.html">8....</option>
   <option value="neun.html">9....</option>
   <input type='submit' value='Abschicken'>
</select>

So, wenn ich jetzt Abschicken drücke soll er mich auf einer der html seiten weiterleiten... aber wie mache ich das?! Wäre nett wenn mit jmd. helfen könnte :)

mfg
 
HTML:
<form name="form" action="">
	<select name="select">
	   <option value="null.html">0....</option>
	   <option value="eins.html">1....</option>
	   <option value="zwei.html">2....</option>
	   <option value="drei.html">3....</option>
	   <option value="vier.html">4....</option>
	   <option value="fünf.html">5....</option>
	   <option value="sechs.html">6....</option>
	   <option value="sieben.html">7....</option>
	   <option value="acht.html">8....</option>
	   <option value="neun.html">9....</option>
	</select>
	<input type='submit' value='Abschicken'>
</form>
<script type="text/javascript">
document.form.onsubmit = function() {
	location.href = this.select.options[this.select.selectedIndex].value;
	return false;
};
</script>
 
Zurück
Oben