By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,848 Members | 3,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,848 IT Pros & Developers. It's quick & easy.

To Generate form fields dynamically

P: 40
I am doing an inventory project using PHP in which there is a text box.The customer id should be entered in that text box.If that customer id is valid,another text box should be generated in which the product id should be entered..If that product id is valid,other 3 text boxes should be generated dynamically in order to do transaction.is it possible to generate forms without a button click?...The order of the forms should be as follows:

[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form method="post" enctype="multipart/form-data">
<table width="500" border="0" align="center" cellpadding="1" cellspacing="6" >
<tbody>
<tr class="text">
<td align="left">Scan/Enter Customer ID:</td>
<td align="left"><input size="30" name="Name" id="Name" type="text" />
</td>
</tr>

<tr class="text">
<td align="left">Scan/Enter Product ID:</td>
<td align="left"><input size="30" name="productName" id="productName" type="text" /></td>
</tr>

<tr class="text">
<td align="left">Product Type</td>
<td align="left">
<select name="productType" id="productType">
<option value="Sales">Sales</option>
<option value="Rental">Rental</option>
<option value="Both">Both</option>
</select>
</td>
</tr>

<tr class="text">
<td align="left">Cost Price/Unit($):</td>
<td align="left"><input size="30" name="costPrice" id="costPrice" type="text" />
</td>
</tr>

<tr class="text">
<td align="left">Quantity:</td>
<td align="left"><input size="30" name="Quantity" id="Quantity" type="text" />
</td>
</tr>

<tr>
<td colspan="2" align="center">
<input type="submit" name="submit" value="Submit" id="submit" /> </td>
</tr>
</tbody>
</table>
</form>
</body>
</html>[/HTML]
Oct 31 '08 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
If that customer id is valid,another text box should be generated in which the product id should be entered..If that product id is valid,other 3 text boxes should be generated dynamically in order to do transaction.is it possible to generate forms without a button click?
Yes, just create them in your validation function.
Oct 31 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.