473,218 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,218 software developers and data experts.

get all value of all row of a dynamic html table

I have create a dynamic html table by adding some rows where I have to put
some value in an input field and now how can I get all value of all row ???

I try this but it doesn' work
button onclik=Alert("EditFieldValue2.value");

Please reply me as soon as possible.

<script>
function addRowToTable()
{
var FieldArray=new Array("ID","CodiceArticolo","Ltd");

var tbl = document.getElementById('SearchTable');
var lastRow = tbl.rows.length;

// if there's no header row in the table, then iteration = lastRow + 1
var iteration = lastRow;
var row = tbl.insertRow(lastRow);

// numero progressivo
var cellFirst = row.insertCell(0);
var textNode = document.createTextNode(iteration);

cellFirst.appendChild(textNode);

// edit per il valore da ricercare sul campo
var cellOne = row.insertCell(1);

var el = document.createElement("input");
el.setAttribute('type', 'text');
el.setAttribute('size', '40');
el.setAttribute('name', 'EditFieldValue' + iteration);
cellOne.appendChild(el);
}

function removeRowFromTable()
{
var tbl = document.getElementById('SearchTable');
var lastRow = tbl.rows.length;
if (lastRow > 2) tbl.deleteRow(lastRow - 1);
}

function openInNewWindow(frm)
{
// open a blank window
var aWindow = window.open("", "TableAddRowNewWindow",

'scrollbars=yes,menubar=yes,resizable=yes,toolbar= no,width=400,height=400');

// set the target to the blank window
frm.target = "TableAddRowNewWindow";

// submit
frm.submit();
}
</script>

<form action="tableaddrow_nw.html" method="get">

<input type="button" value="Add" onclick="addRowToTable();" />
<input type="button" value="Remove" onclick="removeRowFromTable();" />
<input type="button" value="Submit" onclick="openInNewWindow(this.form);" />
<table border="1" id="SearchTable">
<tr>
<th colspan="5">Sample table</th>
</tr>
<tr>
<td>1</td>
<td><input type="text" name="EditFieldValue1" size="40" /></td>
</tr>
</table>

</form>
Jul 23 '05 #1
1 4804
SAN CAZIANO wrote:
I have create a dynamic html table by adding some rows where I have to put some value in an input field and now how can I get all value of all row ???
I try this but it doesn' work
button onclik=Alert("EditFieldValue2.value");

Please reply me as soon as possible.

<script>
function addRowToTable()
{
var FieldArray=new Array("ID","CodiceArticolo","Ltd");

var tbl = document.getElementById('SearchTable');
var lastRow = tbl.rows.length;

// if there's no header row in the table, then iteration = lastRow + 1 var iteration = lastRow;
var row = tbl.insertRow(lastRow);

// numero progressivo
var cellFirst = row.insertCell(0);
var textNode = document.createTextNode(iteration);

cellFirst.appendChild(textNode);

// edit per il valore da ricercare sul campo
var cellOne = row.insertCell(1);

var el = document.createElement("input");
el.setAttribute('type', 'text');
el.setAttribute('size', '40');
el.setAttribute('name', 'EditFieldValue' + iteration);
cellOne.appendChild(el);
}

function removeRowFromTable()
{
var tbl = document.getElementById('SearchTable');
var lastRow = tbl.rows.length;
if (lastRow > 2) tbl.deleteRow(lastRow - 1);
}

function openInNewWindow(frm)
{
// open a blank window
var aWindow = window.open("", "TableAddRowNewWindow",

'scrollbars=yes,menubar=yes,resizable=yes,toolbar= no,width=400,height=400');
// set the target to the blank window
frm.target = "TableAddRowNewWindow";

// submit
frm.submit();
}
</script>

<form action="tableaddrow_nw.html" method="get">

<input type="button" value="Add" onclick="addRowToTable();" />
<input type="button" value="Remove" onclick="removeRowFromTable();" /> <input type="button" value="Submit" onclick="openInNewWindow(this.form);" /> <table border="1" id="SearchTable">
<tr>
<th colspan="5">Sample table</th>
</tr>
<tr>
<td>1</td>
<td><input type="text" name="EditFieldValue1" size="40" /></td>
</tr>
</table>

</form>
This is a mess:
button onclik=Alert("EditFieldValue2.value");


Most people would know what you're trying to do, but sloppiness does
not sit well with programming. In any event, you also didn't mention
browser/error message etc. so I'll assume Internet Explorer - which
doesn't add references to form elements generated with .createElement()
to either the document object or the form's .elements[] collection.
Might want to do it yourself:

<input type="button" value="Add" onclick="addRowToTable(this.form);" />
<input type="button" value="Remove"
onclick="removeRowFromTable(this.form);" />
.................
function addRowToTable(frm)
{
var FieldArray=new Array("ID","CodiceArticolo","Ltd");
var tbl = document.getElementById('SearchTable');
var lastRow = tbl.rows.length;
// if there's no header row in the table, then iteration = lastRow + 1
var iteration = lastRow;
var row = tbl.insertRow(lastRow);
// numero progressivo
var cellFirst = row.insertCell(0);
var textNode = document.createTextNode(iteration);
cellFirst.appendChild(textNode);
// edit per il valore da ricercare sul campo
var cellOne = row.insertCell(1);
var el = document.createElement("input");
el.setAttribute('type', 'text');
el.setAttribute('size', '40');
el.setAttribute('name', 'EditFieldValue' + iteration);
frm[el.name] = frm.elements[el.name] = el;
cellOne.appendChild(el);
}

function removeRowFromTable(frm)
{
var tbl = document.getElementById('SearchTable');
var lastRow = tbl.rows.length;
if (lastRow > 2)
{
tbl.deleteRow(lastRow - 1);
frm['EditFieldValue' + --lastRow] = frm.elements['EditFieldValue' +
lastRow] = null;
}
}

btw it's <input type="button" value="show"
onclick="alert(EditFieldValue2.value)">

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Richard G. | last post by:
Hi All, I am newbie in XML. I am designing a dynamic menu and retrieving data from xml. I have the xml file something like this: <?xml version="1.0" ?> <ROOT>
7
by: Abraham Luna | last post by:
how do i stop the dynamic validators from breaking explorer if i use a dynamic validator and move to a different control it breaks explorer and i can type in the page when i'm not supposed to....
5
by: drdave | last post by:
Hi, I have 6 forms being generated using coldFusion, they are named special1, special2 special3 and so on.. in these forms I have a link to open a new window. I am trying to pickup the...
7
by: skeddy | last post by:
In a nutshell, I'm trying to dynamically create a select box with ResultSet code in vbscript and then need to be able to access the value of that select box later with a Save button. I've got...
5
by: devx777 | last post by:
Hello, I am trying to find some information or an example on how to build a dynamic query in DB2 that would allow me to join a table which its name is stored as a field value on another table....
9
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
3
by: arunank | last post by:
Hi, The following code for dynamic table creation is not working. Can anyone please help me. The dynamically created rows and columns are not getting populated. CODE: ========= <html>
4
by: Michael Munch | last post by:
Hi I want to read the value of af text-field, create dynamic, in a form. Se below a small test-site to do that (but readning fails): I use the function Test_Read for reading the value from the...
12
by: ive1122 | last post by:
Hi guys, I am looking into create a dynamic survey as posted in Get User Input From Dynamic Controls but with some different environment Below is what i am trying to do: First when the user...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.