R
raisin_smiles
Guest
I have a selection box and when an option is chosen I would like depending on the answer a further selection to appear or not.
This has been half achieved as follows, i.e. if the form has its submit button the the post (<form method="POST" action="contact.php"> (See below):-
However I have a few quandries, im not sure the onchange is actually redirecting back to itself.
If the form is reloading the initial selection values will be lost, can this be done in php or will i need to add some javascript?
<select size="1" name="played" onchange="window.location.href="/contact.php">
<option></option>
<option>No</option>
<option>Yes</option>
</select>
<br /> <br />
<?php if(!empty($played)) { ?>
<label for="preference">
Do you prefer the original or the remake?
</label><br />
<select size="1" name="preference">
<option></option>
<option>N/A</option>
<option>Original</option>
<option>Remake</option>
</select>
<br /> <br />
<?php } ?>
This has been half achieved as follows, i.e. if the form has its submit button the the post (<form method="POST" action="contact.php"> (See below):-
However I have a few quandries, im not sure the onchange is actually redirecting back to itself.
If the form is reloading the initial selection values will be lost, can this be done in php or will i need to add some javascript?
<select size="1" name="played" onchange="window.location.href="/contact.php">
<option></option>
<option>No</option>
<option>Yes</option>
</select>
<br /> <br />
<?php if(!empty($played)) { ?>
<label for="preference">
Do you prefer the original or the remake?
</label><br />
<select size="1" name="preference">
<option></option>
<option>N/A</option>
<option>Original</option>
<option>Remake</option>
</select>
<br /> <br />
<?php } ?>