M
M
Michael R.2020-03-23 21:45:52
ubuntu
Michael R., 2020-03-23 21:45:52

How to catch an input change caused by a script?

Greetings!

Some script, by condition, changes input.value. I hang the listener on this one input, but with a new change by the script, the listener does not react. At the same time, the same listener reacts if you change it input.valuemanually (enter a value or click on the arrows in input).

How to catch similar changes in input?

input.addEventListener("change", () => console.log(1));

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
noxford, 2020-01-14
@CynVox

The following actions helped:
1 Administration-file upload-file system specify the path

/var/snap/rocketchat-server/common/upload
(in your case it is a little different)
2 via ssh go to the server and log in as root
sudo su

3 go to the common directory
cd /var/snap/rocketchat-server/common/

4 issue rights to the upload folder
chmod -R 777 upload

5 check and use

S
Serge, 2020-02-04
@svk447

It's even easier for me - the "URL-address of the site" was written incorrectly in the general settings. Everything worked except downloading files.
ps Here's what I found - when the server is restarted, this setting is reset to http and downloads stop working.

R
rokstuk, 2021-11-29
@rokstuk

Also, it is worth checking the proxy settings on Nginx.
By default, Nginx has a 1MB file upload limit. Correct the client_max_body_size directive, which is part of the Nginx ngx_http_core_module module.
https://www.tecmint.com/limit-file-upload-size-in-...

N
nokimaro, 2020-03-23
@Mike_Ro

https://www.w3.org/TR/html4/interact/scripts.html

onchange = script [CT]
The onchange event occurs when a control loses the input focus and its value has been modified since gaining focus. This attribute applies to the following elements: INPUT, SELECT, and TEXTAREA.

that is, you need to trigger onchange() yourself
element.onchange();
or
if ("createEvent" in document) {
    var evt = document.createEvent("HTMLEvents");
    evt.initEvent("change", false, true);
    element.dispatchEvent(evt);
}
else
    element.fireEvent("onchange");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question