M
Michael Munch
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...
<html>
<head>
<script language="JavaScript" type="text/javascript">
function Test_Build() {
var tbody =
document.getElementById('tbllist').getElementsByTagName("TBODY")
[0];
var row = document.createElement("TR");
var td = document.createElement("TD");
td.appendChild(document.createTextNode(""));
S = document.createElement("input");
S.setAttribute("type","text");
S.setAttribute("name","txtName");
S.setAttribute("value","Michael")
td.appendChild(S);
row.appendChild(td);
tbody.appendChild(row); }
function Test_Read() {
// alert(document.getElementById('txtName'));
// alert(document.getElementByTagName('txtName').value);
}
</script>
</head>
<body>
<form id="FormName">
<input type="button" value="Create a textfield" onClick="Test_Build();">
<input type="button" value="Read value from textfield"
onClick="Test_Read();">
<table id="tbllist" cellspacing="0" cellpadding="0" border="0"
width="340">
<tbody>
<tr>
<td>List of name</td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
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...
<html>
<head>
<script language="JavaScript" type="text/javascript">
function Test_Build() {
var tbody =
document.getElementById('tbllist').getElementsByTagName("TBODY")
[0];
var row = document.createElement("TR");
var td = document.createElement("TD");
td.appendChild(document.createTextNode(""));
S = document.createElement("input");
S.setAttribute("type","text");
S.setAttribute("name","txtName");
S.setAttribute("value","Michael")
td.appendChild(S);
row.appendChild(td);
tbody.appendChild(row); }
function Test_Read() {
// alert(document.getElementById('txtName'));
// alert(document.getElementByTagName('txtName').value);
}
</script>
</head>
<body>
<form id="FormName">
<input type="button" value="Create a textfield" onClick="Test_Build();">
<input type="button" value="Read value from textfield"
onClick="Test_Read();">
<table id="tbllist" cellspacing="0" cellpadding="0" border="0"
width="340">
<tbody>
<tr>
<td>List of name</td>
</tr>
</tbody>
</table>
</form>
</body>
</html>