Share on Google+Share on Google+

Anurag Dixit
1 Answer(s)      4 years and 7 months ago
Posted in : JavaScript Questions

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.

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(){

      <input type="button"  value="OK" onclick="generate()"/><input type="text" id="text" />
<div id="div">

Related Tutorials/Questions & Answers:
how to add Arraylist filter for a jsp page showing results from a servlet
Anurag 1x2002 11 Arpit 1x0001 10 Alok... will show as: student_id class_id student_name 1x2001 11 Anurag..._id class_id student_name 1x2001 11 Anurag 1x2002 11
defined actions in struts config still getting a HTTP 404 - Struts
on this would be appreciated Regards Anurag   NVM figured it out
Java Spring Hibernate Struts Training code for programming How can I dynamically load user-entered data as content of jquery dialog? java webcam integration question java coding Fix Scrollbar position in a checkboxList after postback Information Save Alert Country wise redirection to files Interface in javascript connect database with javascript Zip Code ZipCode how to validate the email login How to play FLV video files on Ipad using HTML code or javascript code? Nitobi Grid is not working in IE10/IE11 jquery issue plese help RegEx Tree structure from json whose parents can be dragged and dropped from child newyorklife insurance getElementById not working javascript code for search in html file Implement The Skeleton Code Implement This Skeleton Code Mobile Automation using Appium Computer forensic application Java: Searching a string from doc files java linked list urgent !!! java linked list urgent!!! library management library management library management library management question Html form using JavaScript to display the table content java how to prevent no from unroundin off on clicking text box again in JSP and Jquery graph generation from xml design file display data from database in textbox when id entered in textbox Javascript Code for all fields how to get HTTP GET request value using javascript array Javascript Querry autocomplete(): Spring mvc with jquery: I am not getting correct value in the text filed. Please help me Create SpreadSheet same as excel using java applet Create SpreadSheet same as excel using java applet How to change focus among multiple select boxes? Write JQUERY Code Write JQUERY Code Converting jsp variable to java variable java


Advertisement null