Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

197
Vistas
Add an item in DynamoDb table from HTML form input

I have a form on my HTML page which is as follows:

<div class="form-group">
    <label>Date:</label>
    <input type="date" id="inputId2">
</div>

<div class="form-group">
    <label>Machine ID:</label>
    <input type="text" id="inputId3">
</div>

<div class="form-group">
    <label>Planned Maintenance (Time):</label>
    <input type="text" id="inputId4" onkeydown="getInputValue2();">
</div>

With JavaScript:

function getInputValue2() {
    // Selecting the input element and get its value
    if(event.key === 'Enter') {

        let value = document.getElementById("inputId2").value;
        document.getElementById('Maintenance_date').innerText = value;
        let value2 = document.getElementById("inputId3").value;
        document.getElementById('Maintenance_machineId').innerText = value2;
        let value3 = document.getElementById("inputId4").value;
        document.getElementById('Maintenance_time').innerText = value3;
        }
} 

And I want to send this inputted value into the AWS DynamoDb table and what are my options to do it? I Currently make use rest api to read the data from same DynamoDb table into my HTML page but How to write it from the same page?

Code I used to read from DB URL:

function g_ajaxer(url_str, params, ok_cb, fail_cb){
    $.ajax({
        url: url_str,
        type: "POST",
        data: JSON.stringify(params),
        crossDomain: true,
        contentType: "application/json",
        dataType: "json",
        success: ok_cb,
        error: fail_cb,
        timeout: 6000
    });
}
function GetMachineTime(date)
{
    let readType = mReadType.getMachineTimes;
    var 
        params = { 
            "date": date,
            "readType": readType,
        };
    console.log(params);
    
    g_ajaxer(G_API_GATEWAY_URL_STR, params, function(response){
        handleGatewayResponse(response, readType);
    }, function(error){
        handleGatewayError(error);
    });
}

How to write it using similar type of approach?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda