how do we get data after clicking ok button in textfield

Ads

 
 

Share on Google+Share on Google+

Anurag Dixit
how do we get data after clicking ok button in textfield
1 Answer(s)      5 years and a month ago
Posted in : JavaScript Questions

how do we get data after clicking ok button in textfield

Ads
View Answers

September 17, 2012 at 1:16 PM


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>

Ads









Related Tutorials/Questions & Answers:
how to set size of button,textfield.
how to set size of button,textfield.  how we set size of button textfield etc and reduce problem when click maximize button the text or textfield get large how to set as a preferd size in the panel or frame .when we click
Should not logout after clicking the back/forward button
Should not logout after clicking the back/forward button  Hi all I have wrote a code for login now. User is able to login but after logging in when... if clicked the forward button user gets logged in..!! how can I solve this issue? What
Advertisements
How to Display Next question from database after clicking Next Button using "Arraylist concept"
How to Display Next question from database after clicking Next Button using...()) { Cards get = (Cards) iterator.next... get = (Cards) iterator.next
how to get data using dropdownlist, textbox and search button in jsp
how to get data using dropdownlist, textbox and search button in jsp  Hi, I want to display data using jsp,javascript and mysql. My Q. is If i select...' in textbox and click on search button it should show me all the title names
How to get Button Id ?
How to get Button Id ?  How to get Button ID instead of its value in Servlet. (I am not using jsp right now
Get radio button value after submiting page
Get radio button value after submiting page  Radio buttons are dynamically generated.After selecting radio button & submitting the page , the value of the selected radio button get displayed in that jsp page. <
Toggle hide/show by clicking same button
Toggle hide/show by clicking same button In this tutorial, we will discuss about how to toggle hide/show by clicking button. In the given below 2 example... After clicking button : jqToggleAppearance2.html <!DOCTYPE html> <
How to get data datagrid ?
How to get data datagrid ?  How to get data datagrid in jsp from...://www.roseindia.net/jsp/servlet-jsp-data-list.shtml   thanks. Ok...="button" value="Delete" onclick="javascript:window.location='kaiin_r_kakunin.html
Change paragraph by clicking button(Toggle effect)
Change paragraph by clicking button(Toggle effect) In this tutorial, we will discuss about how to change paragraph by clicking button using jQuery...; OUTPUT After clicking "toggle " button : It will change
how to display the values of one list in other upon clicking a button in struts2
how to display the values of one list in other upon clicking a button in struts2  Hello friends..Am new to struts2..Please any one has to guide me... list upon clicking a button...Can any one provide me the sample code.. Hope
how to access the object of one frame on clicking a button without using this keyword
how to access the object of one frame on clicking a button without using... extends Frame { public static void main(String args[]) { Button b1... Button("Yellow"); mb.add(b1); mb.add(b2); mb.add(b3
retaining save dialog box even after clicking save button - Java Beginners
retaining save dialog box even after clicking save button  I am... "no" to that dialog box i'm unable to get the save dialog box again.how coulg i get it back??(even if i cal save dialog box again it would open again from
Hide text by clicking button
Hide text by clicking button In this tutorial, we will discuss about hide/show... the animation will run OUTPUT Before clicking any button : After click "Hide" button : After clicking "show" button : Download source code
get textfield value in javascript
get textfield value in javascript  How to get and the set value of text field in JavaScript?   Get the text field value in JavaScript <..."> <input type="button" value="Convert" onclick="convertText()">
how to disable back button of a browser after logging in? - JSP-Servlet
how to disable back button of a browser after logging in?  how to disable back button of a browser after logging in?  where is the source code
how to get only checked data
how to get only checked data  my problem is that i have a jsp page on which i retrieve data from the database through servlet , on the jsp page... button it should redirect only checked data to other jsp page which is connected
How do we create session factory in hibernate?
How do we create session factory in hibernate?  Hi, How do we create session factory in hibernate? thanks
How to disable browser back and forward button after logout [in struts2 or jsp]
How to disable browser back and forward button after logout [in struts2 or jsp]  How to disable browser back and forward button after logout... click the back button of the browser more than one time
after entering details in reg page,n enter the submit button,how can v store the data in db, n hw can v retrive the data frm db in jsp
after entering details in reg page,n enter the submit button,how can v store... the submit button,how can v store the data in db, n hw can v retrive the data frm db(m developing new website,so it doesn't ve any data)... bt after storing data
how to create alert message after data submitted into database
how to create alert message after data submitted into database  I want to create alert message box after data stored into database and redirect to another page, how to do
How do we create custom component
How do we create custom component  How do we create custom component in JSF. I couldnot find any category for JSF questions
How to invoke other java class by selecting from dropdown menu and subsequently clicking button in java swing application
How to invoke other java class by selecting from dropdown menu and subsequently clicking button in java swing application  Hello Sir, first of all... a dropdown menu to choose type of report and then click on submit button.On clicking
How to invoke other java class by selecting from dropdown menu and subsequently clicking button in java swing application
How to invoke other java class by selecting from dropdown menu and subsequently clicking button in java swing application  Hello Sir, first of all... a dropdown menu to choose type of report and then click on submit button.On clicking
How to invoke other java class by selecting from dropdown menu and subsequently clicking button in java swing application
How to invoke other java class by selecting from dropdown menu and subsequently clicking button in java swing application  Hello Sir, first of all... a dropdown menu to choose type of report and then click on submit button.On clicking
Retrieve data by clicking a link
Retrieve data by clicking a link  In a page there are 5 links.Every link has a hidden value. According to that hidden value data should be retrieved from the database and data should be displayed in a new page.How to do it?Please
when do we get null pointer exception in java
when do we get null pointer exception in java  can anybody explain me abt null pointer exception? like in wt situation do v get NPE? Are these 2 strings same? String str; String str=null
How to show multiple identicle rows from database on clicking search button to jtable
How to show multiple identicle rows from database on clicking search button to jtable  Hello Sir, I made search button with textfield... and show multiple identical rows from database on clicking search button
How to show multiple identicle rows from database on clicking search button to jtable
How to show multiple identicle rows from database on clicking search button to jtable  Hello Sir, I made search button with textfield... and show multiple identical rows from database on clicking search button
How to show multiple identicle rows from database on clicking search button to jtable
How to show multiple identicle rows from database on clicking search button to jtable  Hello Sir, I made search button with textfield... and show multiple identical rows from database on clicking search button
How do I study big data?
How do I study big data?  Hi, I am a Java Programmer. How do I study big data? Thanks   Hi, You learn like this: Install Hadoop Learn Hadoop Learn Hadoop Framewors Check topics: Big Data and Hadoop Training
how to get string after first occurence of alphanumeric char in java?
how to get string after first occurence of alphanumeric char in java?  how to get string after first occurence of alphanumeric char in java For Example : String = "13(i),145afc34df,1ss,kk,90"; Required output : 13 (i

Ads

 
Advertisement null

Ads