domejercicio3.html 1013 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
<!DOCTYPE html>

<html lang="en">
<head>

</head>
<body>
    <form action="mailto:me@fakeemail.com" id="send" onsubmit="return checkForm();">
        <fieldset>
            <legend>Personal details</legend>
            <p>
                <label>
                    Full name:
                    <input type="text" name="fullname" id="fullname">
                </label>
            </p>
            <p class="errormsg" id="nameerrormsg">Please enter your name above</p>
            <p>
                <label>
                    Street Address:
                    <input type="text" name="streetaddr" id="streetaddr">
                </label>
            </p>
            <p class="errormsg" id="addrerrormsg">Please enter your street address</p>
        </fieldset>
        <input type="submit" value="Submit it!">
        </form>     
</body>
<script>

    function checForm(){

        document.getElementById('send').addEventListener('submit',() => {

        
        
   
    } );
}


</script>
</html>