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...

radio.JPG

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:

<?php
if(isset($_REQUEST['submit'])) {
    
define("e""2.71828183");
    
$i=trim($_REQUEST['i'])/100;
    
$r=trim($_REQUEST['r'])/100;
    
    
//to accomodate different compounding periods including "other"
    
if(empty($_REQUEST['n2'])){
        
$n=trim($_REQUEST['n']);
        }else{
        
$n=trim($_REQUEST['n2']);
    }
    
// Effective value Calculation
    
if(empty($_REQUEST['r'])){
        if(
$n == "Continuous" ){
            
$result=(pow(e,$i)-1)*100;}
        else{
            
$result=((pow(1+($i/$n),$n))-1)*100;}
            
            echo 
"The effective value is ".number_format(round($result3), 3)."%";
    }
    
// Nominal value Calculation
    
if(empty($_REQUEST['i'])){
        if(
$n == "Continuous"){
            
$result=((log10($r+1))/(log10(e)))*100;}
        else{
            
$result=((pow(($r+1), 1/$n)-1)*$n)*100;}
            
            echo 
"The nominal value is ".number_format(round($result3), 3)."%";    
    }
}
?>
and this the text box html..

HTML Code:
<tr>
			<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>
		</tr>
		<tr>
		  <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>
		</tr>
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.