doubt in dynamically text box..plz help me....

hi,,

actally i want to generate 3 text boxes dynamically in a row and it should be repetive if i click a add button..and i need to name this textbox as different name like text1,text2...

I tried a code but i was not able do it clearly...difficulties are i was not able to add

different names,and i cant arrange them in row..

i am requesting to u all plz help me in doing this code...

this is my code

<head>

<script>

function generateRows()

{

var previousclaimid=document.getElementById("div");

var previousdate=document.getElementById("div1");

var previousamount=document.getElementById("div2");

previousclaimid.innerHTML+="<input type='text' name='PclaimId' onkeypress='focusNext(this)'>";

previousdate.innerHTML+="<input type='text' name='PDate'>";

previousamount.innerHTML+="<input type='text' name='PAmount'>";

numLinesAdded++;

}

function button()

{

var previousclaimidt=document.getElementById("divt");

var previousdatet=document.getElementById("div1t");

var previousamountt=document.getElementById("div2t");

previousclaimidt.innerHTML+="PrevoiusAdvanceClaimID";

previousdatet.innerHTML+="PrevoiusAdvanceDate";

previousamountt.innerHTML+="PreviousAdvanceAmount";

var b = document.getElementById("bu");

b.innerHTML+="<input type='button' value='Add>>' onclick='generateRows();'>";

}

</script>

</head>

<body>

<table>

<tr><td>

<table border="0"align="center">

<tbody>

<tr>

<td><div id="divt"></div></td> </tr>

<tr> <td><div id="div1t"></div></td></tr>

<tr><td><div id="div2t"></div></td></tr>

</tbody>

</table>

</td><td>

<table border="0" align="center">

<tbody>

<tr>

<td><div id="div"></div>

<div id="div1"></div>

<div id="div2"></div></td>

</tr>

</tbody>

</table>

</td></tr>

</table>

<div id="bu"></div>

table border="0" class="tab">

<tbody>

<tr>

<td>ClaimID</td>

<td></td>

</tr>

<tr>

<td>PrevoiusAdvancePending</td>

<td>Yes<input type="radio" name="Yes" value="1" onclick="button();"/>No<input type="radio" name="Yes" value="0" onclick="location.href='../10.1.60.5_3A8084/ERP/faces/ClaimsOnline/Forms/AccountHeadView/TourAdvance/TourAdvanceForm.jsp';" /></td>

</tr>

</tbody>

</table>

</body>

[3008 byte] By [vishnu_shankara] at [2007-11-27 0:35:20]
# 1
This link would be helpful:Basically you need to construct the name dynamically. Also what does "numLinesAdded++;" do? http://www.faqts.com/knowledge_base/view.phtml/aid/1785/fid/128
skp71a at 2007-7-11 22:43:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...