Hi Guys
I have just started designing and building the quote system for a client. One of the features of the system us that once a customer clicks on one of the radio buttons it displays that nuber of field boxes, example if one is clicked they show 2 text boxes one for width one for height, if 2 is click then 4 is shown and so on.
However if the customer clicks custom it brings up one box and the customer has to enter the number he/she wants. Problem I'm having is that when i click one all of the boxes show for all of the radio buttons.
I'm a bit stuck I've published the code, can anyone help me?
Code HTML4Strict:<form id="form1" name="form1" method="post" action=""> <p> <input name="option1" type="radio" value="1" /> Option 1</p> <p> <input name="option2" type="radio" value="2" /> Option 2</p> <p> <input name="option3" type="radio" value="3" /> Option 3</p> <p> <input name="option4" type="radio" value="custom" /> Option 4</p> <p> <input type="submit" name="submit" value="choice" /> </p> </form>
PHP Code:
<?php
if (isset($_POST['submit'])) {
$selected_radiobutton = $_POST['option1'];
print "<img src=images/1.jpg width=151 height=153 />
<form name=form1 id=form action= >
<label>Width(mm)</label><input type=text name=width /><br />
<label>Height</label><input type=text name=height />
</form>";
}
else if (isset($_POST['submit'])) {
$selected_radiobutton = $_POST['option2'];
print "<img src=images/2.jpg width=151 height=153 />
<form name=form1 id=form action= >
<label>Width</label>
<input type=text name=width /><br />
<label>Height</label><br />
<input type=text name=height /><br />
<label>Width:</label>
<input type=text name=width /><br />
<label>Height:</label>
<input type=text name=height/> <br />
</form>";
}
if (isset($_POST['submit'])) {
$selected_radiobutton = $_POST['option.
3'];
print "<img src=images/3.jpg width=151 height=153 />
<form name=form1 id=form action= >
<label>Width(mm)</label><br />
<input type=text name=width /><br />
<label>Height(mm)</label><br />
<input type=text name=height /><br />
<label>Width:</label>
<input type=text name=width /><br />
<label>Height:</label>
<input type=text name=height/> <br />
<label>Width:</label>
<input type=text name=width /><br />
<label>Height:</label>
<input type=text name=height/> <br />
</form>";
}
if (isset($_POST['submit'])) {
$selected_radiobutton = $_POST['option4'];
print "
<form name=form1 id=form action= >
<label>Width</label>
<input type=text name=width /><br />
<label>Height</label><br />
<input type=text name=height />
</form>";
}
?>




Bookmarks