0
How I Get data from of form for show in a table
For example if i getting data of a input with this code Function getdata(){ var Nam = document.getElementById("name").value; var Email = document.getElementById("mail").value; var Age = document.getElementById("ages").value; Validate(name,mail,ages); } Function validate (name,mail,ages){ if(name==''){ alert("write your name"); Event.preventDefault(); if(mail==''){ alert("write your name"); Event.preventDefault(); if(ages==''){ alert("write your name"); Event.preventDefault(); }
3 Answers
0
What should happen when 'Nam', 'Email' and 'Age' are not empty?
Also where is the table?
0
Ipang suppose that Name, email and age get the data that the user writing in a different input then I want put those data in a table
0
I'm thinking to assign IDs to some <td> in the table. And when inputs are valid you can use `getElementById` to refer a desired <td> for name, e-mail and age, respectively. You then adjust the desired <td> `innerHTML` attribute, or just the textContent.