title: How to edit a one dimentional array via input form
body: <p>I have written an array to capture a SharePoint input field and add the entry time with JavaScript and then set a history field to the value of the array.  This works fine.  However, I would now like to be able to edit (and delete) the entries in this array via an edit form, but cannot seem to understand how the pick out the specific entry. </p>
  
  <p>I have tried using splice but that doesn't seem to work.  I was able to get the delete to work, but it just deleted the last object in the array, not the specific one that I wanted to delete.  I have reviewed w3schools on this topic but I guess it is not sinking in.  I will have no idea what the user enters, so its not like I can hard code something like the examples on that site. </p>
  
  <pre><code>//this is adds a button under the statusupdate field.  The button will     add the status updates to the status history field. 
  function loadhistory() {
  historyform = "&lt;table id=\'TTTT\' style=\'padding:1px;border-    collapse:collapse;width:800px;vertical-align:text-top;border:2px\'&gt;"
      historyform += "&lt;tr&gt;&lt;td colspan=3&gt;&lt;div&gt;&lt;button type=\'button\'     id=\'add2\' style=\'font-weight:bold;\' onclick=\'statusupdatehistory   ();\'&gt;Add History&lt;/button&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/TABLE&gt;";
  jQuery("#historyforms").html(historyform);
  } //End Load Form
  loadhistory();
  
  // builds the array to store the status updates in. 
  var myArray = new Array();
  
  function statusupdatehistory() {
  
  var entryTime2
  entryTime2 = moment.tz('America/New_York').format('M/D/YY h:mm A z');
  var etime = entryTime2
  //this is the update number.  It is manually entered when sending the  full form communication.  Maybe this can be set to i++ then
  // update the ffcUpdate field. This would prevent the miscounting of the     update forms. It could i++ when the status update is added
  //var updatenumber= getFieldValue("ffcUpdate");
  
  // &amp;&amp; statusupdate.trim()!=''
    var statusupdate = getFieldValue("ffcStatusUpdate");
    if (!(typeof statusupdate === 'undefined') || statusupdate!=null ||     statusupdate ==='') {  
    //  myArray.push("&lt;tr&gt;&lt;td&gt;"+ entryTime2  +"&lt;/td&gt;"+" "+"&lt;td&gt;"+       statusupdate + "&lt;/td&gt;&lt;/tr&gt;");
          myArray.unshift(etime +"&lt;td&gt;"+ statusupdate);
    }
  
    setFieldValue("ffcStatusHistory", myArray.join("|"));
  
    buildhistorytable ();
   } // end function
  
   function loadHistoryrecord () {
    // alert("Whoops,this feature is not ready just yet!")
  
  };
  
  function delHistoryrecord () {
  alert("Whoops,this feature is not ready just yet!")
  //  myArray.splice(1, 1);
  //  setFieldValue("ffcStatusHistory", myArray.join("|"));
  //  buildhistorytable ();
  
  };
  // console.log(myArray);
  //   //document.getElementById('dffs_ffcStatusUpdate').value = '';
  function buildhistorytable () {
    myArray = getFieldValue("ffcStatusHistory", true).split("|");
  
   historytable = "&lt;table cellspacing=\"0\" cellpadding=\"0\"     sytle=\'width:692px;padding-left:10px;padding-right:10px;margin:10px;\'&gt;";
    historytable += "      &lt;tbody&gt;"
    historytable += "          &lt;tr&gt;"
    historytable += "              &lt;table class=\"tbl_border_blk_3b\"     style=\"width:700px;font-weight:normal;font-family:Calibri;color:black;font-    size:11pt\" align=\'left\'&gt;"
   historytable += "   &lt;th bgcolor=\"#6699CC\"colspan=4     style=\"width:692px;font-weight:normal;font-family:Calibri;color:black;font-    size:11pt;text-align:center;\" &gt;Update History&lt;/th&gt;"
   //historytable += "                 &lt;tr style=\'font-    weight:bold;color:white; background-color:#123456;text-align:center;    padding:10px;\'&gt;&lt;td width=\'25%\'&gt;Entered Time&lt;/td&gt;&lt;td&gt;Status Update&lt;/td&gt;&lt;td     width=\'15%\'&gt;Edit&lt;/td&gt;&lt;td width=\'17%\'&gt;Delete&lt;/td&gt;&lt;/tr&gt;";
     historytable += "                 &lt;tr style=\'font-  weight:bold;color:white; background-color:#123456;text-align:center;      padding:10px;\'&gt;&lt;td width=\'25%\'&gt;Entered Time&lt;/td&gt;&lt;td&gt;Status       Update&lt;/td&gt;&lt;/tr&gt;";
    historytable += "                    &lt;tbody&gt;"
  
     if (myArray == null || myArray == undefined) {
    historytable += "&lt;tr&gt;&lt;td colspan=4&gt;There are no Status    updates&lt;/td&gt;&lt;/tr&gt;";
    } else {
        for (var i = 0, len = myArray.length; i &lt; len; i++) {
              historytable += "&lt;tr id=\'row" + i + "\'&gt;";
              historytable += "&lt;td&gt;" + myArray[i] + "&lt;/td&gt;";
              //Edit
              historytable += "&lt;td width=10%&gt;&lt;div style=\'text-  align:center\'&gt;&lt;a href=\'javascript:loadHistoryrecord(" + i + ")\'&gt;&lt;i   class='fas fa-edit' style='font-size:27px;color:green'&gt;&lt;/i&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;";
              //Delete
             historytable += "&lt;td width=10%&gt;&lt;div style=\'text-   align:center\'&gt;&lt;a href=\'javascript:delHistoryrecord(" + i + ")\'&gt;&lt;i    class='fas fa-trash-alt' style='font-   size:27px;color:red'&gt;&lt;/i&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;";
              historytable += "&lt;/tr&gt;"
          } //End For
     } //End if
    //historytable += "              &lt;br&gt;"
    historytable += "          &lt;/tbody&gt;"
    historytable += "      &lt;/table&gt;"
    historytable += "  &lt;/tbody&gt;"
    historytable += "&lt;/table&gt;";
  
   jQuery("#historytables").html(historytable);   
  }; 
  
  buildhistorytable ();
  </code></pre>
  
  <p>So if I had 5 entries in  my status update field, and I wanted to modify the 3rd entry, how would I pluck just that entry out of the array to edit it?</p>