Okay I'm not sure how to put this right.. Let me try to explain.

I want to use one text box and the info inside it will vary depending on radio button selection, screen shot...


if this is the text box
HTML Code:
<input type="text" name="i" id="nomeff" value="<?php ?>" size="5" />
and these are the radio button
HTML Code:
<input type="radio" name="rate" value="i">Effective Value <input type="radio" name="rate" value="r">Nominal value
how are they going to integrate.

Previously I had 2 text boxes so I coded with php in that way..

The php code
PHP Code:

if(isset($_REQUEST['submit'])) {
//to accomodate different compounding periods including "other"
// Effective value Calculation
$n == "Continuous" ){
"The effective value is ".number_format(round($result3), 3)."%";
// Nominal value Calculation
$n == "Continuous"){
$result=((pow(($r+1), 1/$n)-1)*$n)*100;}
"The nominal value is ".number_format(round($result3), 3)."%";    
and this the text box html..

HTML Code:
			<td>Nominal annual interest rate:</td><td><input id="id_i" type="text" name="i" value="<?php if(!empty($_REQUEST['i'])){ echo trim($_REQUEST['i']);} ?>" size="5" /> <span class=nt>%</span></td>
		  <td>Effective Interest Rate:</td><td><input id="id_i" type="text" name="r" value="<?php if(!empty($_REQUEST['r'])){ echo trim($_REQUEST['r']);} ?>" size="5" /> <span class=nt>%</span></td>
Now, how can I serve the same purpose with radio buttons and a text box instead of 2 text boxes,
I hope i was able to explain it some what. Any help highly appreciated.