Forum Discussion

LijaHarris's avatar
LijaHarris
Qrew Cadet
2 years ago

Code Page with User Input to Upload Multiple File Attachments to Quickbase

I was watching the video by Kirk Trachy on uploading multiple file attachments to QuickBase and was wondering if it was possible to use this in a code page and pass the Record ID as an input variable that the user would enter in.  Here is some of my code for example - the Record ID the user would input.  Currently I have one field as an example (Upload File Attachment) but this just allows one file per field.  Is it possible to pass the user input of the Record ID (either using getElementByID or $("input[name=_fid_191]").val() )to the code that Kirk Trachy uses to attach multiple files to the project?:

<tr><td style="float: right;" class=m><input type=text size=40 name=_fid_191 ></td>
<td style="float: right;" class=m>Record ID#:</td></tr>

<tr><td class=m>Upload File</td>
<td class=m><input type=file id="recordid" size=40 name=_fid_261 ></td></tr>

Java:

var id = $("input[name=_fid_191]").val()

or ill use depending on what works:

var id = document.getElementById("recordid").value);


Thank you!



------------------------------
Lija Harris
------------------------------
  • So instead of passing the Parent Record ID via URL parameter you want it set on the form itself?
    Try modifying the line of code in the code page as follows

    //change this line
    const parentRid = urlParams.get('rid');
    //to this
    const parentRid = document.getElementById("recordid").value


    You can get a bit more creative if you want to page to work either with url param or manually  



    ------------------------------
    Simon H
    ------------------------------