Hi,
I have developed one dynamic form data. Form fields are generated from database.
I want to pass the form fields to action page with post method. If any one knows how to send dynamic form fields to action page.
My code is like this:
<form name="quote" method="post" action="test.php" onSubmit="return Valid();">
<table width="548" border="0" align="center" cellpadding="5" cellspacing="2">
<tr>
<td height="25" colspan="3" bgcolor="#006699" class="no-td"><span class="content_bold"> Generate Quote</span>
</td>
</tr><?
include("../config/db_config.php");
$query=mysql_query("select * from category");
$i=0;
while($row=mysql_fetch_array($query))
{
$i=$i+1;
$cat_id=$row['cat_id'];
?> <tr>
<td width="212" height="30" bgcolor="#EFF3FB" class="no-td">
<span class="content">
<input name="<?=$row['category_name']?>" readonly value="<?=$row['category_name']?> :" style="border:0px; background-color:#EFF3FB"></span></td>
<? $result=mysql_query("select * from items where cat_id='$cat_id'");
?>
<? $strId='txtHint'.$i;
// echo $strId;
?>
<td width="212" height="30" align="left" bgcolor="#EFF3FB" class="no-td">
<select name="<?=substr($row['category_name'],0,3)?>" onChange="showUser(this.value,'<?=$strId?>')">
<option value="0">Select Item</option>
<? while($rs=mysql_fetch_array($result))
{
?>
<option value='<?=$rs['item_model']?>'><?=$rs['item_name']?> <?=$rs['item_model']?></option> <? }?> </select>
</td>
<td width="212" align="left" bgcolor="#EFF3FB" class="no-td"><span class="content"><div id=<?=$strId ?> style="font-weight:bold;"><b></b></div></span></td>
</tr>
<? }?>
<tr class="no-tr">
<td height="30" class="no-td"> </td>
<td height="30" colspan="2" class="no-td"> </td>
</tr>
<tr>
<td height="30" bgcolor="#EFF3FB" class="no-td"> <span class="content"><strong>Customer Info:</strong></span></td>
<td height="30" colspan="2" bgcolor="#EFF3FB" class="no-td"><textarea name="customer_info" id="customer_info" cols="45" rows="5"></textarea></td>
</tr>
<tr>
<td height="30" class="no-td"> </td>
<td height="30" colspan="2" class="no-td"> </td>
</tr>
<tr>
<td height="30" bgcolor="#EFF3FB" class="no-td"> <span class="content">Executive Name:</span></td>
<td height="30" colspan="2" bgcolor="#EFF3FB" class="no-td"><input type="text" name="ex_name" id="ex_name" /></td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF" class="no-td"> <span class="content">Grand Total:</span></td>
<td height="30" colspan="2" bgcolor="#FFFFFF" class="no-td"><span class="content">Rs. </span>
<input type="text" name="sum" id="sum" readonly style="border:0px; background-color:#FFF"/></td>
</tr>
<tr>
<td height="30" bgcolor="#EFF3FB" class="no-td"> <span class="content"><strong>Tax</strong></span></td>
<td height="30" colspan="2" bgcolor="#EFF3FB" class="no-td"> </td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF" class="no-td"> <span class="content">Vat :</span></td>
<td height="30" colspan="2" bgcolor="#FFFFFF" class="no-td"><input type="checkbox" name="vat" id="vat" value="4" checked / ></td>
</tr>
<tr>
<td height="30" class="no-td"><span class="content">Discount:</span></td>
<td height="30" colspan="2" class="no-td"><select name="discount" onChange="return calDiscount(this.options[this.selectedIndex].value)">
<option value="0">--Select--</option>
<option value="1">1%</option>
<option value="2">2%</option>
<option value="3">3%</option>
</select> d</td>
</tr>
<tr>
<td height="30" bgcolor="#EFF3FB" class="no-td"><span class="content">Sub Total:</span></td>
<td height="30" colspan="2" bgcolor="#EFF3FB" class="no-td"><span class="content">
Rs. <input type="text" value="" name="total" style="border:0px; background-color:#EFF3FB" />
<div id="total" style="font:Verdana, Geneva, sans-serif; font-weight:bold; color:#069;"></div>
</span></td>
</tr>
<tr>
<td height="30" class="no-td"><span class="content">Total in words:</span></td>
<td height="30" colspan="2" class="no-td"><input type="text" name="words" id="textfield"></td>
</tr>
<tr>
<td height="30" bgcolor="#EFF3FB" class="no-td"> </td>
<td height="30" colspan="2" bgcolor="#EFF3FB" class="no-td"><input type="submit" name="button" id="button" value="Submit" class="loginbtn"/>
<input type="reset" name="button2" id="button2" value="Reset" class="loginbtn" /></td>
</tr>
</table>
</form>
</td>
</tr>
<tr class="no-tr">
<td height="33" colspan="7" class="no-td"> </td>
</tr>
<tr class="no-tr">
<td height="2" colspan="7" bgcolor="#A4CD50" class="no-td"></td>
</tr>
<tr class="no-tr">
<td height="25" colspan="7" class="no-td"><span class="content">Copyright © 2010</span></td>
</tr>
</table>