Gaio DataOS
English
English
  • Welcome to the Gaio Platform documentation!
  • Documentação
    • General information
      • Functioning Structure
      • Login
      • Home page
    • Applications
    • Studio
      • Suit
      • Data Sources
      • Tasks
        • ETL
          • Builder
          • SQL
          • SQL External
          • Insert Table
          • Insert Row
          • Update
          • Delete
          • Create Table
          • Quick Table
          • pivot table
          • Unpivot Table
          • Run Process
          • Rest
          • Parameters to Table
          • Table to Parameters
          • Users
          • CSV Web
          • Google Planilhas
        • Analytics
          • Sample
          • AutoML
          • Scoring
          • Cluster
          • Main Components
          • Association Rules
          • Time Series
          • Python
        • Delivery
          • Report
          • Power Search
          • Content
          • Form
          • Exportar Output
          • Banner
          • Export CSV
          • Map
          • Insights
          • API
          • SMS
          • Whatsapp
          • Email
          • Network
      • Parameters
      • Forms
      • Files
      • Action Buttons
      • Top Menu
        • SQL
        • Edit Bucket Tables
        • Executions in Progress
        • Map Editor
        • Schedule
        • Models
        • Cognitive
        • Error log
        • Edit Dashboard
        • Chat - GPS
        • General Menu
    • Administration
      • Permissions
      • Users
      • Data Sources
      • Repositories
        • Creation
        • Data Management
      • Sharing
      • Schedules
      • Logs
    • Keyboard Shortcuts
  • Integrações
    • LDAP
  • HUB
    • Exemplos
      • Tarefa Conteúdo
        • Manual Form
  • FAQ
  • Gestão de Servidor
    • Gaio startup
  • What's New!
    • Release Notes
      • 2022
  • Import
    • Editor de Mapas
    • Parâmetros
    • Formulários
    • Processos
    • Editar Dashboard
    • Administração
      • Usuários
        • Permissões
      • Fontes de Dados
      • Repositórios
        • Criação
        • Gestão de Dados
      • Compartilhamento
      • Agendamento
      • Log
    • Consulta
Powered by GitBook
On this page
  • Tab - HTML
  • Tab - Java
  1. HUB
  2. Exemplos
  3. Tarefa Conteúdo

Manual Form

PreviousTarefa ConteúdoNextFAQ

Last updated 1 year ago

The example below requires knowledge of HTML, JavaScript and .

Build a manual form with the that inserts data into tables and runs processes.

Tab - HTML

<!-- css ====> https://purecss.io/ -->

<link rel ="stylesheet" href ="https://cdnjs.cloudflare.com/ajax/libs/pure/2.0.5/pure-min.css" >
​
    <form id ="myForm" class ="pure-form pure-form-stacked" >
        <fieldset>
        <legend> My form </legend>
            <label> Name </label>
            <input type ="text" id ="my_name" name ="my_name" />
             <label> Email </label>
            <input type ="text" id ="my_email" name ="my_email" />
              <label > Status </ label >
            <select id =" my_state " name =" my_state " >
                <option> AL </option>
                <option> CA </option>
                <option> IL </option>
            </select>
            
            <label class ="pure-checkbox" >
                <input type =" checkbox " id =" my_accept " name =" my_accept " /> I accept </ label >

        </fieldset>
    <button type ="submit" class ="pure-button pure-button-primary" > Submit </button>
</form >

Tab - Java

// mandatory: wait for html to load, then reference JS with html
document. addEventListener ( ' DOMContentLoaded ' , function () {
const myForm = document. getElementById ( " myForm " );
​
const my name = document. getElementById ( " my_name " );
const my email = document. getElementById ( " my_email " );
const my state = document. getElementById ( " my_status " );
const my_accept = document. getElementById ( " my_accept " );
​
​
// Listen for the SUBMIT - SEND button
myForm. addEventListener ( "submit" , function (evt) {
    evt. preventDefault (); // prevent the form from redirecting from the page
    sendData (); // send the data
});
​
​
// send the parameter values ​​to Gaio
function sendData () {
        // prepare PROCESS EXECUTION type
        // dispatchEvent is the BRIDGE of this code with GAIO
        // 1. Prepare
        const runProcess = {
          formFlowId : 658 , // process number
          formType : ' loadFlow ' , // loads process in background,
          formReload : true , // reload the current page
        }
        
        // 2. Set parameters
        // 2.1 One per line
        rotateProcess.params = [
          { paramName : ' my_name ' , paramValue : my_name.value || 'Default Name' },
          { paramName : ' my_email ' , paramValue : my_email.value || 'email@padrao.io' },
          { paramName : ' my_state ' , paramValue : my_state.value || 'MG' },
          { paramName : ' my_accept ' , paramValue : my_aceite.checked ? 'Accepted' : 'I give up' },
        ];
    
        console. log ( runProcess );
        dispatchEvent ( runProcess );

}

}, false );

Parameters
Content task