473,769 Members | 5,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("E ditFieldValue2. value");

Please reply me as soon as possible.

<script>
function addRowToTable()
{
var FieldArray=new Array("ID","Cod iceArticolo","L td");

var tbl = document.getEle mentById('Searc hTable');
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(l astRow);

// numero progressivo
var cellFirst = row.insertCell( 0);
var textNode = document.create TextNode(iterat ion);

cellFirst.appen dChild(textNode );

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

var el = document.create Element("input" );
el.setAttribute ('type', 'text');
el.setAttribute ('size', '40');
el.setAttribute ('name', 'EditFieldValue ' + iteration);
cellOne.appendC hild(el);
}

function removeRowFromTa ble()
{
var tbl = document.getEle mentById('Searc hTable');
var lastRow = tbl.rows.length ;
if (lastRow > 2) tbl.deleteRow(l astRow - 1);
}

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

'scrollbars=yes ,menubar=yes,re sizable=yes,too lbar=no,width=4 00,height=400') ;

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

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

<form action="tablead drow_nw.html" method="get">

<input type="button" value="Add" onclick="addRow ToTable();" />
<input type="button" value="Remove" onclick="remove RowFromTable(); " />
<input type="button" value="Submit" onclick="openIn NewWindow(this. form);" />
<table border="1" id="SearchTable ">
<tr>
<th colspan="5">Sam ple table</th>
</tr>
<tr>
<td>1</td>
<td><input type="text" name="EditField Value1" size="40" /></td>
</tr>
</table>

</form>
Jul 23 '05 #1
1 4855
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("E ditFieldValue2. value");

Please reply me as soon as possible.

<script>
function addRowToTable()
{
var FieldArray=new Array("ID","Cod iceArticolo","L td");

var tbl = document.getEle mentById('Searc hTable');
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(l astRow);

// numero progressivo
var cellFirst = row.insertCell( 0);
var textNode = document.create TextNode(iterat ion);

cellFirst.appen dChild(textNode );

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

var el = document.create Element("input" );
el.setAttribute ('type', 'text');
el.setAttribute ('size', '40');
el.setAttribute ('name', 'EditFieldValue ' + iteration);
cellOne.appendC hild(el);
}

function removeRowFromTa ble()
{
var tbl = document.getEle mentById('Searc hTable');
var lastRow = tbl.rows.length ;
if (lastRow > 2) tbl.deleteRow(l astRow - 1);
}

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

'scrollbars=yes ,menubar=yes,re sizable=yes,too lbar=no,width=4 00,height=400') ;
// set the target to the blank window
frm.target = "TableAddRowNew Window";

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

<form action="tablead drow_nw.html" method="get">

<input type="button" value="Add" onclick="addRow ToTable();" />
<input type="button" value="Remove" onclick="remove RowFromTable(); " /> <input type="button" value="Submit" onclick="openIn NewWindow(this. form);" /> <table border="1" id="SearchTable ">
<tr>
<th colspan="5">Sam ple table</th>
</tr>
<tr>
<td>1</td>
<td><input type="text" name="EditField Value1" size="40" /></td>
</tr>
</table>

</form>
This is a mess:
button onclik=Alert("E ditFieldValue2. 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="addRow ToTable(this.fo rm);" />
<input type="button" value="Remove"
onclick="remove RowFromTable(th is.form);" />
............... ..
function addRowToTable(f rm)
{
var FieldArray=new Array("ID","Cod iceArticolo","L td");
var tbl = document.getEle mentById('Searc hTable');
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(l astRow);
// numero progressivo
var cellFirst = row.insertCell( 0);
var textNode = document.create TextNode(iterat ion);
cellFirst.appen dChild(textNode );
// edit per il valore da ricercare sul campo
var cellOne = row.insertCell( 1);
var el = document.create Element("input" );
el.setAttribute ('type', 'text');
el.setAttribute ('size', '40');
el.setAttribute ('name', 'EditFieldValue ' + iteration);
frm[el.name] = frm.elements[el.name] = el;
cellOne.appendC hild(el);
}

function removeRowFromTa ble(frm)
{
var tbl = document.getEle mentById('Searc hTable');
var lastRow = tbl.rows.length ;
if (lastRow > 2)
{
tbl.deleteRow(l astRow - 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
4042
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
1892
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. thank you.
5
3163
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 formname passed along to the new window.. the window opener function is: <SCRIPT LANGUAGE = "JavaScript">
7
13444
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 the select box filling with code similar to below: <SCRIPT LANGUAGE=VBSCRIPT RUNAT=SERVER> Public Sub BuildComboBox(rs, dispname, val, name, selected) 'rs = the recordset 'val = fieldname to place in the val of the option
5
14305
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. I have done this in the past in SQL server, but DB2 is not as easy... Anyone out there that can help me? Your help will be much appreciated.
9
2986
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 got the core of the javascript from here: http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm I noticed in the demo that sometimes the content takes a long
3
2116
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
4889
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 dynamic create text-field "txtName". I thanks...
12
24815
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 click the button, it will populate a dynamic table with radio button for the survey questionnaire However, i was unable to get its value (for score calculation) after clicking the submit button Beside i am using an ajax extension (updatePanel) for the...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.