<!-- HTML5 Input Form Elements -->
<p>Click on the "Choose File" button to upload a file:</p>
<input id="fileupload" type="file" name="fileupload">
<button id="upload-button" onclick="uploadFile()"> Upload </button>
<!-- Ajax JavaScript File Upload Logic -->
<script>
async function uploadFile() {
let formData = new FormData();
formData.append("file", fileupload.files[0]);
await fetch('libs/upload/upload1.php', {
method: "POST",
body: formData
});
alert('The file has been uploaded successfully.');
}
</script>
This code works perfectly when the form is opened from the magnifing glass in the form builder module. However when opening it from a launch menu button I get this error
Screenshot from 2023-05-15 11-02-16.png
You do not have the required permissions to view the files attached to this post.
Ok, figured it out. I was trying to open in an edit form and should have been using a launch form since I didn't really need to edit a record. For future reference, if I want to make an edit form how is one opened to a specific record?
I tried to reproduce the error by placing an HTML object with your code on a form. However, I did not receive an error when opening the form. Could it be that another code is causing the problem?
To open a specific record in an edit form, you can add the record ID to the "Record ID" field of the Run object.