Wie kann ich die ausgewählten Werte in den Dropdown-Listen von einer HTML-Seite auf eine neue Seite anzeigen/umleiten? Wenn ich zum Beispiel einen Wert aus der Dropdown-Liste auswähle und wenn ich auf die Schaltfläche "GO" klicke, wird die Seite auf eine neue Seite mit dem ausgewählten Wert geleitet. Brauche Hilfe zu diesem Thema.HTML - So zeigen Sie ausgewählte Werte aus dem Dropdown-Menü an und verweisen sie auf eine neue HTML-Seite
<!DOCTYPE html>
<html>
<body>
<div align="center">
<center>
<h4 style="color:darkblue">Choose Your Food/Beverage & Status : </h3>
</center>
<table>
<tr>
<td>
<font size=2>
<B>Choose a Food/Beverage : </B>
</font>
<select ID="foodbeverage">
\t
\t <optgroup label="DEFAULT">
\t <option value = "NONE">NONE</option>
\t </optgroup>
\t
\t <optgroup label="Food">
\t <option value = "chickenchop">Chicken Chop</option>
\t <option value = "pasta">Pasta</option>
\t <option value = "pizza">Pizza</option>
\t <option value = "chocolate">Chocolate Cake</option>
\t <option value = "redvelvet">Red Velvet Cake</option>
\t <option value = "icecream">Ice Cream Cake</option>
\t </optgroup>
\t
\t <optgroup label="Beverages">
\t <option value = "milk">Milk</option>
\t <option value = "freshjuice">Fresh Juice</option>
\t <option value = "icecream">Ice Cream</option>
\t <option value = "coffee">Coffee</option>
\t <option value = "carbonated">Carbonated Can Drink</option>
\t <option value = "water">Water</option>
\t </optgroup>
\t
\t </select>
<br/>
<font size=2>
<B>Choose a Food/Beverage : </B>
</font>
<select ID="foodbeverage">
\t
\t <optgroup label="DEFAULT">
\t <option value = "NONE">NONE</option>
\t </optgroup>
\t
\t <optgroup label="Food">
\t <option value = "chickenchop">Chicken Chop</option>
\t <option value = "pasta">Pasta</option>
\t <option value = "pizza">Pizza</option>
\t <option value = "chocolate">Chocolate Cake</option>
\t <option value = "redvelvet">Red Velvet Cake</option>
\t <option value = "icecream">Ice Cream Cake</option>
\t </optgroup>
\t
\t <optgroup label="Beverages">
\t <option value = "milk">Milk</option>
\t <option value = "freshjuice">Fresh Juice</option>
\t <option value = "icecream">Ice Cream</option>
\t <option value = "coffee">Coffee</option>
\t <option value = "carbonated">Carbonated Can Drink</option>
\t <option value = "water">Water</option>
\t </optgroup>
\t
\t </select>
<br/>
</td>
<td>
<font size=2>
<B>Dine In or Take Away : </B>
</font>
<select ID="status">
\t
\t <optgroup label="DEFAULT">
\t <option value = "NONE">NONE</option>
\t </optgroup>
\t
\t <optgroup label="STATUS">
\t <option value = "dinein">Dine In</option>
\t <option value = "takeaway">Take Away</option>
\t </optgroup>
\t </select>
<br/>
<font size=2>
<B>Dine In or Take Away : </B>
</font>
<select ID="status">
\t
\t <optgroup label="DEFAULT">
\t <option value = "NONE">NONE</option>
\t </optgroup>
\t
\t <optgroup label="STATUS">
\t <option value = "dinein">Dine In</option>
\t <option value = "takeaway">Take Away</option>
\t </optgroup>
\t </select>
<br/>
</td>
</tr>
</table>
<br/>
<form method="get" action="newPage.html">
<input type="submit" value=" GO " />
</form>
<br/>
</body>
</html>
Auf dieser Seite möchte ich die Werte entsprechend angezeigt/umgeleitet werden.
<!DOCTYPE html>
<html>
<body>
<div align="center">
<font size=4>
<B>Food/Beverage Selected : </B>
</font>
<br/>
<br/>
<font size=4>
<B>Dine In/Take Away : </B>
</font>
<br/>
<br/>
</body>
</html>
Die erste Seite kann nicht auf die zweite Seite umleiten :( – cerberus99
Es sollte funktionieren. Plz überprüfen Sie Ihren Code. Plz Siehe meine aktualisierte Antwort. Ich denke, Sie brauchen jquery-Bibliothek dafür. Danke – Preet
Wenn Sie nicht jquery verwenden möchten dann habe ich eine lösung dafür ich bin mir nicht sicher, ob es funktioniert sehe meine aktualisierte antwort – Preet