Why does this keep resetting when I submit? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why does this keep resetting when I submit?

I originally asked Stack Overflow but people just kept disliking instead of actually helping me and the one person who did help me said that the function that calls e.preventDefault() returns true sometimes when its supposed to return false, I have no clue what in the function is returning true. I asked for an elaboration on what could be returning true but have gotten no response. Thank you in advance. https://code.sololearn.com/Wcg8l296qp49/#html I did some editing to make it work with SoloLearn

28th Sep 2020, 9:53 PM
MyNameIsMutable
MyNameIsMutable - avatar
6 Answers
+ 1
I have found the answer. The reason why it kept refreshing is because I was supposed to do an event delegation since it wasn't directly in the HTML and also as a bonus I was told that there isn't supposed to be any DOM manipulation inside of the function that calls preventDefault()
29th Sep 2020, 9:20 PM
MyNameIsMutable
MyNameIsMutable - avatar
+ 3
You have not posted the full code. SoloLearn has a limit to the maximum length of a question. Please copy your code into the playground and share it here instead.
28th Sep 2020, 10:18 PM
XXX
XXX - avatar
+ 2
From personal experience you’re not really going to find help on Stack, you’re mostly on your own. They kind of view themselves as “High and Mighty” imo.
28th Sep 2020, 10:57 PM
Harmanpreet Singh Gill
Harmanpreet Singh Gill - avatar
+ 1
What I’ve heard from my teachers and classmates is that people will downvote posts if the answer already exists.
28th Sep 2020, 10:50 PM
Harmanpreet Singh Gill
Harmanpreet Singh Gill - avatar
+ 1
I updated it to have the code. Also if that's the case I wish they would just point me in the right direction because I have been looking for answers for awhile now.
28th Sep 2020, 10:53 PM
MyNameIsMutable
MyNameIsMutable - avatar
+ 1
Yes, I went to the Gods for help to find they were just men who weren't very nice lol
28th Sep 2020, 11:07 PM
MyNameIsMutable
MyNameIsMutable - avatar