DropDown-Werte an URL übergeben

L

LAPIS

Guest
Hallo,

ich habe folgendes Problem:

Ich möchte einen Banner basteln, der mit 2 Drop-Downs bestückt ist, aus beiden Drop-Downs sollen die Werte gezogen werden und in der verlinkten URL verücksichtigt werden. Ich weiß aber nach langer Fehlersuche immernoch nicht was ich falsch gemacht habe.

hier der gekürzte Quelltext:


<table border="0" width="468" height="60" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" valign="top"><select class="bgb1" name="selected_ort_id">
<option value="">Abflughafen</option>
<option value='BSL'>Basel</option>
<option value='BYU'>Bayreuth</option>
.
.
.

<option value='STR'>Stuttgart</option>
<option value='ZRH'>Zürich</option> </select><br>


<select class="bgb1" name="selected_land_id">
<option value="">Wählen Sie ein Land aus</option>
<option value='85'>Ägypten</option>
<option value='102'>Äthiopien</option>
.
.
.
<option value='83'>Zimbabwe</option>
<option value='84'>Zypern</option></select>

<a href="http://URL.php_etc.=
+selected_land_id.options[selected_land_id.selectedIndex].value
+weitereURL=+selected_ort_id.options[selected_ort_id.selectedIndex].value target=_blank onmouseover="MM_swapImage('suchen','','/img/n_suchenblau_o.gif')" onmouseout="MM_swapImgRestore()"><img name="suchen" src="/img/n_suchenblau_n.gif" width="68" height="15" alt="SUCHEN" border="0"></a></td>
</tr>



Vielen Dank für Eure Hilfe
 
Da fehlt erstens ein " (schliessendes Anführungszeichen).

<a href="http://URL.php_etc.=+selected_land_id.options[selected_land_id.selectedIndex].value
+weitereURL=
+selected_ort_id.options[selected_ort_id.selectedIndex].value" target=_blank onmouseover="MM_swapImage('suchen','','/img/n_suchenblau_o.gif')" onmouseout="MM_swapImgRestore()"><img name="suchen" src="/img/n_suchenblau_n.gif" width="68" height="15" alt="SUCHEN" border="0"></a>

Ausserdem hab ich sowas noch nie gesehen, ausser Du machst da was mit PHP, was ich nicht verstehe. So würds gehen:

<script language="javascript">
function Suchen(){
var sLand = document.getElementById("Select2")[document.getElementById("Select2").selectedIndex].value;
var sAb = document.getElementById("Select1")[document.getElementById("Select1").selectedIndex].value;
var sURL = "http://www.domain.com/index.htm?Land=" + sLand + "&Ab=" + sAb;
window.open(sURL,"Suche");
}
</script>
.
. (hier die zwei Selects)
.
<a href="http://www.domain.com/index.htm" onclick="Suchen();return false;" onmouseover="MM_swapImage('suchen','','/img/n_suchenblau_o.gif')"
onmouseout="MM_swapImgRestore()"><img name="suchen" src="/img/n_suchenblau_n.gif" width="68" height="15" alt="SUCHEN" border="0"></a>

Griessli
Irene
 
Zurück
Oben