Forum Discussion

MarielaVasquez's avatar
MarielaVasquez
Qrew Member
4 years ago

api edit with html

This is my code, previously what I was doing was adding a record, now what I need is to edit the records but I don't know how to get the record id to modify the record from where the page is called.

<!DOCTYPE html>
<html lang="es">

<head>
<meta charset="utf-8" />
<title> Tickets de Mantenimiento </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<div class="allrequired">

<body class="blurBg-false" style="background-color:#EBEBEB">

<link rel="stylesheet" href="https://qb.veinsamotors.com/files/venisacrm/files/skyblue.css" type="text/css" />
<script type="text/javascript" src="https://qb.veinsamotors.com/files/venisacrm/files/jquery.min.js"></script>

<!-----------<script>
var urlParams = new URLSearchParams(window.location.search);
const urlParams.get("a"); // "dbpage"
const urlParams.get("pagename"); // "InvoicePDF.html"
const urlParams.get("rid"); // value of [Record ID#]
console.log(rid);
let urlParams.get("rid");
document.getElementById("rid").textContent = `Edit Record # ${rid}`;
</script> ------------>



<form name=qdbform method="post" onsubmit='return validateForm(this)' encType='multipart/form-data' action=https://veinsacr.quickbase.com/db/brczq73ui?act=API_EditRecord&apptoken=cq3k57cd4jgeyucgn8nhwc3tiicj; class="formoid-default-skyblue" style="background-color:#FFFFFF;font-size:14px;font-family:'Open Sans','Helvetica Neue','Helvetica',Arial,Verdana,sans-serif;color:#666666;max-width:480px;min-width:150px" >


<a href="https://veinsacr.quickbase.com/db/brczq73ui"><img src="https://qb.veinsamotors.com/files/venisacrm/images/ico.png" width="55" height="70"></a>
<div align="center"><img src="http://qb.veinsamotors.com/Cloud/Logos/AGEHolding/CINTILLO-LOGOS-AGE-HOLDING.jpg" width="300" height="100"></div>
<p>
<h2>TICKETS MANTENIMIENTO</h2>

<!--------------------------------------------------- nombre ------------------------------------------->

<input type=hidden name=fform value=1>
<div class="element-input"><label class="title">Nombre Completo</label>
<input class="medium" type="text" name="_fid_6" required /></div>

<!------------------------------------------------- Departamento --------------------------------------->

<input type=hidden name=fform value=1>
<div class="element-input"><label class="title">Departamento</label>
<input class="medium" type="text" name="_fid_9" required /></div>


<!--------------------------------------------- Numero de telefono ------------------------------------------->


<!--------------------------------------------- Email ------------------------------------------->

<input type=hidden name=fform value=1>
<div class="element-input"><label class="title"> Correo </label>
<input class="medium" type="text" name="_fid_10" required /></div>

<!-------------------------------------------- Clasicacion del trabajo --------------------------->





<label for="start">Fecha limite de Entrega:</label>

<input type="date" id="start" name="_fid_12"
value="08-12-2020"
min="01-01-2020" max="12-31-2020">


<!--------------------------------------------Java de Fecha --------------------------->





<!--------------------------------------------Numero random --------------------------->


<input class="medium" type="textarea" id="demo" name="_fid_23" style="visibility:hidden" />

<input class="medium" type="text" id="Nuevo" name="_fid_30" style="visibility:hidden" />







</div><span class="clearfix"></span>
</div>
<input type=hidden name=rdr value='https://veinsacr.quickbase.com/db/bp8bfx5e3?a=dbpage&pageID=8'>
<input class="submit" type=submit value=Guardar onClick="mi_alerta()">
</form>







<script type="text/javascript" src="venisacrm/files/skyblue.js"></script>

<script lang="javascript">
function CheckForOther (item, origlen)
{
var sitem = item.options[item.selectedIndex];

if (item.selectedIndex == (item.length - 1))
{
var val = prompt ("ADD A NEW CHOICE:", "");

if (val == null)
item.selectedIndex = 0;
else
{
var slen = item.length;

if (slen == origlen+1){
item.options[slen] = new Option (sitem.text, sitem.value);
}

item.options[item.length-2].text = val;
item.options[item.length-2].value = val;
item.selectedIndex = item.length-2;
}
}
}
</script>
<script lang=javascript>
function validateForm(theForm)
{
}

function mi_alerta () {
alert ("Registro Guardado");
windows.location = 'https://veinsacr.quickbase.com/db/bm7n7yjim?a=dbpage&pageID=6';
}
</script>

<script>
document.getElementById("demo").value = Math.random()* 100000 * 3.14159265359;
</script>








</body>
</html>

------------------------------
Mariela Vasquez
------------------------------

4 Replies

    • MarielaVasquez's avatar
      MarielaVasquez
      Qrew Member
      I have already reviewed the codes there, they are functional but the examples are only from one record and I need to modify at least 5 at the same time and the codes they published do not allow that

      ------------------------------
      Mariela Vasquez
      ------------------------------
      • JustinTorrence's avatar
        JustinTorrence
        Qrew Cadet
        ā€‹> I need to modify at least 5 at the same time
        How will you determine which records you will be editing? Do you intend for the user to provide? Gather the information contextually from the previous page?


        ------------------------------
        Justin Torrence
        Quickbase Expert, Jaybird Technologies
        jtorrence@jaybirdtechnologies.com
        https://www.jaybirdtechnologies.com/#community-post
        ------------------------------