Answer the question
In order to leave comments, you need to log in
How to send data from a form and then write it to a variable?
I need to get data from an input field (html), then send it to the server and the server should write it to a variable. Perhaps the question is easy, but I did not find anything on the Internet, and I'm a beginner
Answer the question
In order to leave comments, you need to log in
Make a form in HTML, read js data from it on a trigger, form a POST request and send it to the server in JSON format via fetch or XHR, there the lisner will parse the request body and turn it into an object and assign it to a variable (either in the field of the object, or in map).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question