#Card Information form submit problem

5 messages · Page 1 of 1 (latest)

sharp seal
#

I want to submit my credit card name and numbers and I choose required so it needs to be written. I want to close the form if everything is written. But right now I can click on pay and nothing happens, not even the closing.

this is my code:
cardForm.addEventListener('submit', function(e){
const cardFormData = new FormData(cardForm)
const fullName = cardFormData.get('CardData')
details.style.display = "none"

console.log(cardFormData + fullName)

})

and my scrim: https://scrimba.com/scrim/co060441c952162626eade4ed

you need to push 1 item, scroll down on complete order and should see the consent card. What am I doing wrong?

Scrimba

Learn to code with interactive screencasts. Our courses and tutorials will teach you React, Vue, Angular, JavaScript, HTML, CSS, and more. Scrimba is the fun and easy way to learn web development.

stuck harness
#

<button type="submit" class="pay-btn">Pay</button> Your button is outside the form

#

so it can't submit the form

#

move it before the closing </form> tag in index.html file

sharp seal
#

ahhhhhh