F
fidodido
I was asked to do this....
Dynamically move "text1" and "hidden1" into the "form1" .....
Not by creating new elements, but moving the "text1" and "hidden1"
elements into the form using javascript, after i click the submit
button....
So if i loop the "form1", i can get the values for "text1" and
"hidden1" too.....
Is that possible ?
Here is the source ....
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<title>...</title>
<script type="text/javascript">
function submitIt()
{
var obj_text1 = document.getElementById("text1");
var obj_hidden1 = document.getElementById("hidden1");
var oFormObj = document.getElementById("form1");
for (var i=0;i<oFormObj.length;i++)
{
alert(oFormObj.name+" -- "+oFormObj.type)
}
}
</script>
</head>
<body>
<table border="0">
<tr>
<td>
<input type=text value='text111' name=text1 id=text1 >
<input type=hidden value='hidden111' name =hidden1 id=hidden1 >
<form id=form1 name=form1 action=test.html>
<input type=text value='text222' name =text2 id=text2 >
<input type=hidden value='hidden222' name =hidden2 id=hidden2>
<br>
<input type=button value=submit onClick="submitIt()">
</form>
</td>
</tr>
</table>
</body>
</html>
Dynamically move "text1" and "hidden1" into the "form1" .....
Not by creating new elements, but moving the "text1" and "hidden1"
elements into the form using javascript, after i click the submit
button....
So if i loop the "form1", i can get the values for "text1" and
"hidden1" too.....
Is that possible ?
Here is the source ....
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<title>...</title>
<script type="text/javascript">
function submitIt()
{
var obj_text1 = document.getElementById("text1");
var obj_hidden1 = document.getElementById("hidden1");
var oFormObj = document.getElementById("form1");
for (var i=0;i<oFormObj.length;i++)
{
alert(oFormObj.name+" -- "+oFormObj.type)
}
}
</script>
</head>
<body>
<table border="0">
<tr>
<td>
<input type=text value='text111' name=text1 id=text1 >
<input type=hidden value='hidden111' name =hidden1 id=hidden1 >
<form id=form1 name=form1 action=test.html>
<input type=text value='text222' name =text2 id=text2 >
<input type=hidden value='hidden222' name =hidden2 id=hidden2>
<br>
<input type=button value=submit onClick="submitIt()">
</form>
</td>
</tr>
</table>
</body>
</html>