<INPUT type="button" value="Add Row" onclick="addRow('dataTable')" />
<INPUT type="button" value="Delete Row" onclick="deleteRow('dataTa
+ble')" />
<TABLE id="dataTable" width="900px" align="center" border="1">
<TR>
<TH>Chk</TD>
<TH>From</TH>
<TH>TO</TH>
<TH>Activities Performed</TH>
<TH>Format</TH>
<TH>Time</TH>
</TR>
</TABLE>
function addRow(tableID) {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
var cell1 = row.insertCell(0);
var element1 = document.createElement("input");
element1.type = "checkbox";
element1.name="chkbox[]";
cell1.appendChild(element1);
var from = row.insertCell(1);
var element2 = document.createElement("input");
element2.type = "text";
element2.style['width'] = '100px';
element2.name = "txtbox[]";
from.appendChild(element2);
var to = row.insertCell(2);
var element3 = document.createElement("input");
element3.type = "text";
element3.style['width'] = '50px';
element3.name = "txtbox[]";
to.appendChild(element3);
var act = row.insertCell(3);
var element4 = document.createElement("input");
element4.type = "text";
element4.style['width'] = '500px';
element4.name = "txtbox[]";
act.appendChild(element4);
var format = row.insertCell(4);
var element5 = document.createElement("input");
element5.type = "text";
element5.style['width'] = '50px';
element5.name = "txtbox[]";
format.appendChild(element5);
var time = row.insertCell(5);
var element6 = document.createElement("input");
element6.type = "text";
element6.style['width'] = '50px';
element6.name = "txtbox[]";
time.appendChild(element6);
}
function deleteRow(tableID) {
try {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
for(var i=0; i<rowCount; i++) {
var row = table.rows[i];
var chkbox = row.cells[0].childNodes[0];
if(null != chkbox && true == chkbox.checked) {
table.deleteRow(i);
rowCount--;
i--;
}
}
}catch(e) {
alert(e);
}
}
</script>
Here is my perl script
<table width='100%' >
<tr><td align=center><input type=button name='add' value='Add'
+ onclick='Add_Form(this.form)' accesskey="s" title="alt+s"></td></tr>
+
</table>
function Add_Form(frm) {
alert('came');
var url = 'http://newsdpr.etpl.org/dpr/Add_App_Entry?s
+ession=$session_id';
frm.action=url;
frm.submit();
}
how to send this dynamically added table data to Add_App_Entry page?
Thanks in advance Lakshmi
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.