dear frds i need
some info reg: dynamic row generation
how to generate a new row
at the end of the table at last field when i press tab or enter keys it will automatically generate a new row

8 Years
Discussion Span
Last Post by gaurish.patil

You need scripting language for think like this as you need to run sort of loop cycle, I would say PHP would be your best solution, JavaScript may be to complex. However all depends on your experiences


Let's say you have:

		<table id="myTable">
          <th colspan="2">Phone</th>
        <td><input type="text" name="newname" /></td>
        <td><input type="text" name="newphone" /></td>
        <td><input type="button" onclick="addContact()" value="Add"/></td>

You can create a function like:

<script type="text/javascript" languaje="javascript">
function addContact(){
   var myTable = document.getElementById("myTable");
   var newTR = document.createElement("tr");
   var newName = document.createElement("td");
   newName.innerHTML = document.forms[0].newname.value;
   var newPhone = document.createElement("td");
   newPhone.innerHTML = document.forms[0].newphone.value;

hello friends.
I have two table,one(product table) for model& type of product,another maintaining (data table)quantity of a particular model,type.the attributes r like,Date,Model,Type & quantity.
I hav to create form where I can take d model & type from product table 7 put on form.
that's mean the no. of options wich contains model& text box which contains the type of that model ,both of may increase/decrease so I hav to make the dynamic them.
Also I wana add a new row by pressing tab in last textfield,
which add adds new row with option (model)&textfield.
cna any one tell me how can I do In HTMl or java script or PHP.

thanks a lot in advance....

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.