Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to read textbox values from html and insert them into tables using java script

how to read html texbox values and insert them into databaase table
Comment

add textbox data to table html and javascript

$(function() {
  $('form[name="registration"]').submit(function(e) {
    e.preventDefault();
    var name  = $('input[name="name"]').val(),
        sName = $('input[name="surname"]').val(),
        cnp   = $('input[name="cnp"]').val(),
        age   = $('input[name="age"]').val(),
        ocu   = $('select[name="ocupatia"]').val();

   if($('.results').length < 1) {
      $('body').append('<table class="results">'
                        +'<tr>'
                          +'<th>Nume</th>'
                          +'<th>Prenume</th>'
                          +'<th>CNP</th>'
                          +'<th>Varsta</th>'
                          +'<th>Ocupatia</th>'
                        +'</tr>'
                        +'<tr>' 
                          +'<td>'+name+'</td>'
                          +'<td>'+sName+'</td>'
                          +'<td>'+cnp+'</td>'
                          +'<td>'+age+'</td>'
                          +'<td>'+ocu+'</td>'
                        +'</tr>'
                     + '</table>');
   }

  });

});
Comment

PREVIOUS NEXT
Code Example
Javascript :: es6 parameter destructuring nested object 
Javascript :: can i pack a cross excutable file with nodejs 
Javascript :: Cannot find module Cannot find module 
Javascript :: javascript to send email on button click 
Javascript :: node js euro sign 
Javascript :: random height fallling object in js 
Javascript :: alpiee js hide amother button click 
Javascript :: click to enlarge in javascript 
Javascript :: ubicar escrol en el final jquey 
Javascript :: conditionally add property to JSON object javascript es6 
Javascript :: react-native-calendars how to mark selected day 
Javascript :: javascript split domain 
Javascript :: how to change the backgroung of one button when click the other one 
Javascript :: trim para remover excesso de espaço  
Javascript :: Switching words in a string using replace 
Javascript :: logvalue returned from array 
Javascript :: nuxt js set background color of body 
Javascript :: navigate between files in react js 
Javascript :: get computer name in javascript in adobe livecycle designer 
Javascript :: javascript remove null object 
Javascript :: javascript class prototype 
Javascript :: onclick clear input field javascript 
Javascript :: how to jump one page to another on specific tab elementor 
Javascript :: shorten req.body. function 
Javascript :: SHOPIFY STORE FRONT PASSWORD 
Javascript :: blue pring GUI react 
Javascript :: expression expected.ts switch case 
Javascript :: npm install error `not foundram Files/nodejs/npm: 3: /mnt/c/Program Files/nodejs/npm:` 
Javascript :: jquery ajax snippet 
Javascript :: jquery init dropdown 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =