select item and verify right amount
Posted: Thu Jun 17, 2010 3:57 pm
hey all
Here is my code first of all
Next here is what I am trying to do i just need to do a if statment
I need to when I select a radio button which is near each plan and take whats i enter in the text box and be sure that the amount in the text box isnt smaller then the min deposit or the max deposit.
as i said i think i just need a if statment but i need to get it to read the selected buttons min and max depo
Thanks
Here is my code first of all
Code: Select all
<table width="100%" align="center" class="style1">
<?php
$r = mysql_query("SELECT * FROM packages") or die(mysql_error());
while($row = mysql_fetch_array($r, MYSQL_ASSOC)) {
if($row['pack_status']=='1')
echo'
<tr>
<td></td><td width="114" class=plan_left>'.$row['name'].'</td><td width="179" class=plan_middle>Spend Amount</td><td width="118" class=plan_right>Rate</td></tr>';
$q = mysql_query("SELECT * FROM plans WHERE parent='{$row['id']}'") or die(mysql_error());
while($pla = mysql_fetch_array($q, MYSQL_ASSOC)) {
if($pla['status']=='1')
echo'
<tr><td><input type="radio" value="'.$pla['id'].'" name="plan"></td>
<td width="114" class=style2>'.$pla['plan_name'].'</td>
<td width="179" class=style2>'.$pla['min_deposit'].' - '.$pla['max_deposit'].' </td>
<td class=style2 width="118">'.$pla['percent'].'</td>
</tr>
';
}
}
?>
<tr>
<td width="116"><span class="style2"><img src="../images/forms/money_dollar.png" width="16" height="16" /> Amount</span></td>
<td width="144"><input name="amount" type="text" class="textbox" id="amount" size="25" maxlength="25" /></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input name="save" type="submit" class="n_register" id="save" value="Invest Funds" />
</div></td>
</tr>
</table>
</form><?php } ?>
Next here is what I am trying to do i just need to do a if statment
I need to when I select a radio button which is near each plan and take whats i enter in the text box and be sure that the amount in the text box isnt smaller then the min deposit or the max deposit.
as i said i think i just need a if statment but i need to get it to read the selected buttons min and max depo
Thanks