Page 1 of 1

environment/hash variable in an onchange event?

Posted: Wed Sep 24, 2025 10:45 pm
by homa
How can I retrieve the available environment/hash variable in an onchange event with a file?
The browser console throws the following error:

Code: Select all

Uncaught ReferenceError: nuHash is not defined
    onchange http://192.168.1.78/index.php:3
2 index.php:3:22

Code: Select all

nuChangeFile(event);alert("Datei onchange"); // Initial report for verification
// nuDebug(nuHash());
console.log("Hash:", nuHash()); // in Browser-Console visible

Re: environment/hash variable in an onchange event?

Posted: Wed Sep 24, 2025 11:30 pm
by steven
Hi homa,

nuHash() is only a PHP function.

What value are you trying access?


Steven

Re: environment/hash variable in an onchange event?

Posted: Thu Sep 25, 2025 9:07 am
by homa
Hi Steven,
Thank you for opening my eyes. In the heat of the moment, I forgot to consider the client and server sides — and therefore JavaScript (JS) and PHP.
My first step should be to work with the hash variables.
I plan to load files into the database, retrieve the file name and type, and store these in two additional database fields.
The second step would be to load the PDF files from the database and display them to the user in the browser. But one thing at a time.
As a beginner with nuBuilder, I am currently struggling to handle and edit variables and other database fields. Could you offer any advice?
Matthias

Re: environment/hash variable in an onchange event?

Posted: Thu Sep 25, 2025 9:41 am
by steven
Matthias,

We'll need to know more about what you're trying to do.

If you are able to upload a copy of your current database or provide some screenshots, that would be good.


Steven

Re: environment/hash variable in an onchange event?

Posted: Thu Sep 25, 2025 9:46 am
by kev1n
I agree with Steven; we need more details.
Specifically, we need to know how you are loading data into the database. Are you using the nuBuilder File object (Uppy) or another method?
Only then can we provide targeted help, since the answer depends heavily on the method being used.