'WEBFLOW / How to capture a value from a input that is inside a form in the webflow CMS
so i have this form on a webflow page that have a name, email and phone input fields. im trying to capture what the user write in these inputs fields and register them into variables in the java script custom code when the user click on the submit button. here's what i'm trying to do:
(function () {
document.getElementById("button").onclick = function () {
var name = document.getElementById("name").value;
var email = document.getElementById("email").value;
var telefone = document.getElementById("Telefone").value;
console.log(name);
console.log(email);
console.log(telefone);
};
})();
this code don't give me any of the information i tried to find on the console.log.
can you guys help me capture these variables?
thanks in advance!
Solution 1:[1]
Can you try by replacing this code
document.getElementById("button")
with
document.getElementById("ID of button")
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Muhammad Rameez |
