Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa HTML How to Validate dynamically created text box in HTML using Javascript
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Sujitha
How to Validate dynamically created text box in HTML using Javascript
0 Answer(s)      a year and 7 months ago
Posted in : HTML


Here is the HTML code to create text boxes dynamically. It works properly in IE but not in fire fox and chrome. how to make this to work in all browsers.

And also how to validate the text boxes created dynamically.

    <html> 
    <head> 
    <title>Multiple Text area Validation</title> 
    <script> 
     function addInputBox() { 
              var ni = document.getElementById('myDiv'); 
              var ni1=document.getElementById('myDiv1');
              var numi = document.myForm.inputboxlength; 
              var numi1=document.myForm.inputboxlength;
              var num = parseInt(numi.value) +1; 
              var num1=parseInt(numi1.value)+1;
              numi.value = num; 
              numi1.value=num1;
              var newdiv = document.createElement('div'); 
              var newdiv1=document.createElement('div');
              newdiv.innerHTML = "<input type=\"text\" name=\"txt"+num +"\" />" ; 
              newdiv1.innerHTML="<input type=\"text\" name=\"txt1"+num1+"\"/>";
              ni.appendChild(newdiv); 
              ni1.appendChild(newdiv1);
         } 
            function reset() 
            { 
                  var numi = document.myForm.inputboxlength; 
                  numi.value=0; 
            } 
         </script> 
         </head> 
         <body onload="reset()"> 
           <form name="myForm" action="result.jsp" > 
              <p><input type='button' onclick='addInputBox()' value='Add'/></p> 
              <input type="hidden" name="inputboxlength" value="0" /> 
              <!--<div id="myDiv"><div id="myDiv1"></div> </div> -->
               <div id="mydiv"><div id="mydiv1"></div></div>
             <input type="submit" value="Submit" > 
          </form> 
        </body> 
        </html>

Advertisement
View Answers

Related Tutorials/Questions & Answers:
How to Validate dynamically created text box in HTML using Javascript
How to Validate dynamically created text box in HTML using Javascript  Here is the HTML code to create text boxes dynamically. It works properly.... And also how to validate the text boxes created dynamically. <html>
how to validate values in the dynamically created textboxes?
how to validate values in the dynamically created textboxes?  how to validate values in the dynamically created textboxes in HTML using javascript...;script language="javascript"> var n=1; //FUNCTION TO REMOVE TEXT BOX ELEMENT
Advertisements
how to validate the telephone number without using jquery in html with javascript
how to validate the telephone number without using jquery in html with javascript  how to validate the telephone number without using jquery in html with javascript
How to give value for select in HTML dynamically using javascript
How to give value for select in HTML dynamically using javascript  hi. Consider the situation i am having 2 select options called degree... should be displayed in the dept list. how to do this using javascript
dynamically writing text javascript
dynamically writing text javascript  dynamically writing text javascript. Is it possible
dynamically writing text javascript
dynamically writing text javascript  dynamically writing text javascript. Is it possible
Accessing MS ACCESS databse using a HTML webpage [created using Javascript]
Accessing MS ACCESS databse using a HTML webpage [created using Javascript]  HI team, This is Srinivas, and I have a query and i explained here... I have to save some datas in an MS ACCESS database file [*.mdb], after
how to access element added via javascript dynamically using jsp code
how to access element added via javascript dynamically using jsp code ... javascript dynamically using the jsp code. i am adding empty records on .jsp page.... (because they have been created dynamically by javascript) Now,i want to save
how to create a text box using awt
how to create a text box using awt  give an example how creat multi buttons & text boxes
add text box and select list dynamically and get its value to store it into database using jsp request parameter
add text box and select list dynamically and get its value to store it into database using jsp request parameter  its very helpful when you have only dynamically added text field but want code to retrive value of dynamically
Insert value of dynamic generated text box in jsp using javascript
Insert value of dynamic generated text box in jsp using javascript  hello sir , i want to generate dynamic text box at run time and i did that using... that dynamically generated text box value into database at a time without
How to get the text from textarea in HTML and store it in database using javascript and jsp
How to get the text from textarea in HTML and store it in database using javascript and jsp  How to get the text from textarea in HTML and store it in database using javascript and jsp <script> function str() { <
How to display user entered information using HTML and JavaScript
How to display user entered information using HTML and JavaScript. We are going to describe How to display user entered information using HTML and JavaScript. First of all we have created HTML form with two text fields "
Display current date in text box in JSP using javascript
Display current date in text box in JSP using javascript In this section you will learn how to display current date in text box using JavaScript.For this purpose, we have used JavaScript Date object. The getDate() method returns the day
validate radio button using javascript
validate radio button using javascript  validate radio button using javascript
How to check text in textbox using JavaScript
How to check text in textbox using JavaScript  How to check text in textbox using JavaScript I have a form in HTML that contains text feilds... me.   JavaScript validation example to check text in textfeild <
How do i validate form using javascript and send data to database?
How do i validate form using javascript and send data to database?  I need a "JOIN US" form that can validate using javascript and be able to connect....") return false; } } return true } function validate(){ var
how to print HTML using javascript or Jquery
how to print HTML using javascript or Jquery  is there any way to print a document(created using Html and javascript) without using window.print, which works for all the browser specially chrome and firefox, I have used
How to get data from DB in to Text box by using Jsp & Ajax
How to get data from DB in to Text box by using Jsp & Ajax   I want to get the data from database in to text box in a jsp page by using Ajax. If I enter the letter A in the textbox it should show only those values which starts
How to save run time created text-file on a disk using jsp/servlet?
How to save run time created text-file on a disk using jsp/servlet?  I have a JSP page with save button.In that I created the file(e.g a.txt) at run-time,when I click on the save button,it will ask where to save the file
populate Combo Box dynamically
populate Combo Box dynamically  Hi, How to populate the Combo Box dynamically using Flex with Jsp's
how to display data from mysql table in text box using jsp??
how to display data from mysql table in text box using jsp??  <...="row">Reference GPC</th> 113: <td><input type="text" name...; 115: <th>Numint</th> 116: <td><input type="text
JavaScript regex validate validate Zip.
JavaScript regex validate validate Zip.  JavaScript regex validate - how to validate Zip?   <html> <head> <title>Zip Code validation using regex</title> <script type="text/javascript">
Select Box Validation in JavaScript
created one JavaScript in which one select box is created name "select your...Select Box Validation in JavaScript In this section we will discuss about select box validation in JavaScript. Select box allows you to create drop down list
Calling In JavaScript Functions from HTML Form To Validate User Entered Data
Calling In JavaScript Functions from HTML Form To Validate User Entered... and editing my html to call my functions to validate the user entered data...; <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <
how to insert list box in java script dynamically and elements retrieving from database like oracle
how to insert list box in java script dynamically and elements retrieving from database like oracle  Hi, how to dynamically increase size of list box in javascript when elements retrieving from database.. That is whenever I
how to create a combo box in html
how to create a combo box in html  <tr> <td>Number<span class=mandatory>*</span></td> <td> <select name... the following link: HTML Combobox
how to display webservice response in a text box
how to display webservice response in a text box  Hallo, i have created a webservice and when i sended request to my webservice its sending proper response . the point is how to dispaly the response values in a text box usinj
create text box by clicking button and submittong text in text box using submit
create text box by clicking button and submittong text in text box using... is created. and i want to do that when i enter the text input in text box and when i... box in SOP). i also want the text box should generate in front of NEW button
javascript regex validate url
javascript regex validate url  How to validate URL in regex Javascript   <html> <head> <title>Url validation using regex</title> <script type="text/javascript"> function validate
how do i update my database with the help of update syntax in html <text/javascript>? How to write 'where' statement in this?
how do i update my database with the help of update syntax in html ? How to write 'where' statement in this?  var sqlmek="update into Student_info... ActiveXObject("ADODB.Recordset"); alert('How are you!!'); cn.Open(strConn
 

 

 

DMCA.com