anurag

anurag

how to get textbox in java script having a ok button before it .whatever value i enter in the textbox the same no of txtbox display(ie. suppose we enter 6,the 6 txtbox display as i press ok) and each of the txtbox has a ok button before it ,when i click to the ok button the text comes out from the txtbox.

View Answers

September 14, 2012 at 11:47 AM

Here is a javascript example that accepts the number from the user in order to generates the entered number of textboxes.

<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();">'+'<input type="text"><br>\n';
}

}
function getData(){

}
</script>
<body>
<pre>
      <input type="button"  value="OK" onclick="generate()"/><input type="text" id="text" />
   </pre>
<div id="div">
</div>
</body>
</html>









Related Tutorials/Questions & Answers:
anurag
anurag
Advertisements
anurag
anurag
anurag
anurag
ModuleNotFoundError: No module named 'topsis-Anurag'
ModuleNotFoundError: No module named 'topsis-Anurag'  Hi, My... 'topsis-Anurag' How to remove the ModuleNotFoundError: No module named 'topsis-Anurag' error? Thanks   Hi, In your python
how to add Arraylist filter for a jsp page showing results from a servlet
Anurag 1x2002 11 Arpit 1x0001 10 Alok... 1x2001 11 Anurag 1x2002 11 Arpit .............going... 11 Anurag 1x2002 11 Arpit .............going
defined actions in struts config still getting a HTTP 404 - Struts
on this would be appreciated Regards Anurag   NVM figured it out

Ads