Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

HTML Object error Topic is solved

Questions related to using nuBuilder Forte.
Post Reply
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

HTML Object error

Unread post by treed »

I have a simple form with an html object that retrieves a file.

Code: Select all

  <!-- 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.
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: HTML Object error

Unread post by treed »

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?
kev1n
nuBuilder Team
Posts: 4565
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 529 times
Contact:

Re: HTML Object error

Unread post by kev1n »

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.
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: HTML Object error

Unread post by treed »

There was just this one html object on the form. Simply changing from edit to launch worked.
Post Reply