
August 1st, 2011, 01:49 PM
|
|
Contributing User
|
|
Join Date: Jun 2011
Posts: 60
Time spent in forums: 13 h 22 m 2 sec
Reputation Power: 2
|
|
|
How to get values from dynamically created textbox to save in db
Hi Guys i am creating dynamic text boxes and i want to store their values into db,.
any help will be apreciated ..
thanks
code of a quick example of dynamic generated textbox is below:
[code]
<html>
<head>
<script language="javascript">
function init()
{
//element with NO id
// newFieldElementNoId = document.createElement( 'INPUT' );
// newFieldElementNoId.onblur = show;
// document.body.appendChild(newFieldElementNoId);
//element with id
var i;
for ( i=0;i<5;i++)
{
newFieldElement = document.createElement( 'INPUT' );
newFieldElement.setAttribute('id','myfieldid'+i);
newFieldElement.setAttribute('name','myfieldname'+i);
newFieldElement.onblur = show;
document.body.appendChild(newFieldElement);
}
}
function show(){
alert( 'id=' + this.getAttribute('id') + "\n" + 'name=' + this.getAttribute('name') + "\n" + "value=" + this.value );
}
</script>
</head>
<body onload="init()">
</body>
</html>
|