You can use this simple method to add new text boxes: -
/* container - HTML element in which textBox needs to be added
labelString - (optional) Label string for text box
textValue - (optional) Text value for text box
*/
function addNewTextBox(container, labelString, textValue) {
if(!container) {
return false;
}
// Create Label
var label = document.createElement('label');
label.value = (lableString ? labelString : 'Label');
// Create Text box
var textBox = document.createElement('input');
textBox.type = 'text';
label.value = (textValue ? textValue: '');
container.appendChild(label);
container.appendChild(textBox);
return textBox;
}
can you please explain this to me in a greater detail....
the code i have which needs to be repeated is :
<table width="85%" border=0 align="center" cellPadding=2 cellSpacing=1 bgcolor="#ffffff" id=TABLE01>
<td height="25" bgColor=#eeeeee class='cellDesc' width="35%"><font color="BLACK"><strong>SHARED DRIVE ACCESS </strong></font></td>
<tr>
<td height="25" bgColor=#eeeeee class='cellDesc' width="35%">Drive Name<font color='#ff0000'>*</font></td>
<td bgColor=#eeeeee>
<% if len(sessionNum)>0 then %>
<input name='drive_name' class='cellData' maxlength="30" style="WIDTH: 302px; HEIGHT: 17px" size=45 title="Enter Number"
value="<%=rsData.fields("drive_name")%>" tabIndex=1 >
<% ELSE %>
<input name='drive_name' class='cellData' maxlength="30" style="WIDTH: 302px; HEIGHT: 17px" size=45 title="Enter Ticket Number" tabIndex=1>
<% END IF %>
</td>
</tr>
<tr>
<td height="25" bgColor=#eeeeee class='cellDesc' width="35%">Drive Access Add, Ticket Number<font color='#ff0000'>*</font></td>
<td bgColor=#eeeeee >
<% if len(sessionNum)>0 then %>
<input name='ge_sso_id' class='cellData' maxlength="30" style="WIDTH: 302px; HEIGHT: 17px" size=45 title="Enter Drive "
value="<%=rsData.fields("drive_add_ticket_no")%>" >
<% ELSE %>
<input name='drive_add_ticket_no' class='cellData' maxlength="30" style="WIDTH: 302px; HEIGHT: 17px" size=45 title="Enter Drive" value="" >
<% END IF %>
</td>
</tr>
<!-- Date Of Request -->
<tr bgColor=#eeeeee>
<td width="35%" class='cellDesc'>Date Of Drive Add Request <font color='#ff0000'>*</font></td>
<td>
<% if len(sessionNum)>0 then %>
<input name='drive_add_date' class='cellData' readonly title="Date Of Request"
value= <%=doj%> >
<A onmouseover="window.status ='Date Picker';return true;" onmouseout="window.status='';return true;" href="javascript:show_calendar('access.drive_add_date','mm-dd-yyyy');" >
<IMG src="images/calendar.png" align=middle border=0 tabIndex=9>
</A>
<% ELSE %>
<input name='drive_add_date' class='cellData' readonly title="Date Of Request" >
<A onmouseover="window.status ='Date Picker';return true;" onmouseout="window.status='';return true;" href="javascript:show_calendar('access.drive_add_date','mm-dd-yyyy');" >
<IMG src="images/calendar.png" align=middle border=0 tabIndex=9>
</A>
<% END IF %>
</td>
</tr>
</table>
i need this to be repeated as required and then
also
Save these values in the database
i can't think how am i gonna send multiple enteries into the database..