
how do we get data after clicking ok button in textfield

Here is a javascript example that accepts the number from the user in order to generates the entered number of textboxes. Onclicking the button with respect to each textbox,it will give you the value of that particular textbox.
<html>
<script>
function generate()
{
var no = document.getElementById("text").value;
var tbl = document.getElementById("div");
for(var i =1;i<=no;i++)
{
tbl.innerHTML = tbl.innerHTML +' <input type="button" value="ok" onclick="getData('+i+');">'+'<input type="text" id=text'+i+'><br>\n';
}
}
function getData(i){
var value=document.getElementById('text'+i).value;
alert(value);
}
</script>
<body>
<pre>
<input type="button" value="OK" onclick="generate()"/><input type="text" id="text" />
</pre>
<div id="div">
</div>
</body>
</html>