Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

198
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda