1 year ago

#193981

test-img

t3rror

Input/Button to submit,and activate function

When clicking on the Submit i would like to submit form and to invoke function which is going to make forms display property to NONE,and my div.slika to get class of .display. I am so new at this,i and i know i am missing some code in this one, but have no clue how to fix it... I can make transition happen with this one, but form wont submit.

    <form class='formclass' method="POST" action="contact.php">
                  <input name="name" type="text" placeholder="First Name" required>
                  <input name="lastname" type="text" placeholder="Last Name" required>
                  <input name="email" type="email" placeholder="E-mail" required>
                  <textarea name="message" placeholder="Message" required></textarea>
                  <input onclick="removeForm()" id="confbtn" type="submit" value="CONFIRM" class='confbtn'>
       </form>
       <div id="slika" class="slika">
            <img src="img/gif.gif" alt="">
          </div>

JS

const form = document.querySelector('.formclass');
const formButton = document.querySelector('.confbtn');
const thankYou = document.querySelector('.slika');


function removeForm() {
  
  form.style.display = "none";
  thankYou.classList.add('display');

}

CSS

.slika {
    height: 500px;
    position: absolute;
    opacity: 0;
    z-index: -4;
  }

  .display {
    opacity: 1;
    transition: all 2s ease;
  }

javascript

html

forms

animation

confirm

0 Answers

Your Answer

Accepted video resources