Wohnort ein neues Input feld kommt
PLZ / Wohnort
wenn ich Straße auswähle soll anstatt PLZ / Wohnort
Straße / Hausnr kommen
Wie setzte ich dies mit Php um? oder andere Möglichkeit?
Mit der If abfrage gehts nicht da er bei der auswahl ja noch nicht weiß ob 1 oder 2?
<form action="index.php?menu-save" method="POST" name="add">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="31%"><b>Name:</b></td>
<td><input name="Name" type="text" value="" size="31" maxlength="50"></td>
</tr>
<tr>
<td><b>Auswahl:</b></td>
<td><select name="Zuordnung" size="1">
<option value="1">Wohnort</option>
<option value="2">Straße</option>
</select></td>
</tr>';
if ($Zuordnung = 1) {
echo '<tr>
<td><b>PLZ / Wohnort:</b></td>
<td><input name="Anzahl" type="text" value="" size="3" maxlength="5"> <input name="Ziel" type="text" value="" size="25" maxlength="50"></td>
</tr>';
}elseif ($Zuordnung = 2) {
echo '<tr>
<td><b>Straße / Nr.:</b></td>
<td><input name="Anzahl" type="text" value="" size="25" maxlength="2"> <input name="Ziel" type="text" value="" size="3" maxlength="50"></td>
</tr>';
}
echo '<tr>
<td colspan="3"><br><b>Beschreibung:</b></td>
</tr>
<tr>
<td colspan="3"><textarea name="Beschreibung" cols="65" rows="10" id="Beschreibung"></textarea></td>
</tr>
</table>
<input type="submit" style="border: solid 1px black; background-color:#cfcfcf; margin-left:400px;" name="add" border="0" value="Hinzufügen"></form>
Zuletzt modifiziert von Siggi am 18.02.2013 - 13:14:44


