Answers for "how to get data from form using javascript"

7

javascript get form data

<html>
    <form id="myForm">
        <input type="text" name="email" value="[email protected]">
    </form>
    <p id='text'></p>

    <script>
        window.setInterval(()=>{
            var myForm = document.getElementById('myForm');
            var text = document.getElementById('text');

            text.innerText = myForm.elements['email'].value;
        }, 1);
    </script>
</html>
Posted by: Guest on June-07-2020
1

get form data in js

// return data in key value pair
$('#form').serializeArray().reduce(function(obj, item) {
    obj[item.name] = item.value;
    return obj;
}, {});
Posted by: Guest on August-06-2021
0

js retrieve form data

var nameValue = document.getElementById("uniqueID").value;
Posted by: Guest on February-02-2021
-2

javascript form data

var formData = new FormData();
fromData.append('name','value');
Posted by: Guest on September-03-2020

Code answers related to "how to get data from form using javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language