Why my transform property is not stop even when I fill correctly. I tried it from morning 5Am and now it's 1:12Pm. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Why my transform property is not stop even when I fill correctly. I tried it from morning 5Am and now it's 1:12Pm.

After filling the form correctly the button should be stop at one position for click. I want to make the button clickable after correct fillng. I tried in different ways, but I couldn't understand why it still not working... If anyone here who can solve this then please share with me that trick please https://code.sololearn.com/Wt5h5gcPNGOi/?ref=app https://code.sololearn.com/W2q9RtJd8adm/?ref=app

17th Dec 2022, 7:44 AM
Pooja Sahoo
Pooja Sahoo - avatar
5 Answers
+ 2
There are 2 problems in the code: 1) you should access the content of input after the event listener was triggered 2) combine the 2 else if statement which checks position of "." Here's the corrected code: https://code.sololearn.com/WizJTyfmRqdj/?ref=app
17th Dec 2022, 12:26 PM
Roopesh
Roopesh - avatar
+ 2
Thanks a lot ๐Ÿ™‡๐Ÿปโ€โ™€๏ธ angel
17th Dec 2022, 12:36 PM
Pooja Sahoo
Pooja Sahoo - avatar
+ 2
you can try this: https://www.w3resource.com/javascript/form/email-validation.php put this inside your script tags: let name= document.getElementById('inputName'); let email= document.getElementById('inputEmail'); let btn= document.getElementById("submit"); btn.addEventListener("mouseover", (button) => { let nameVal = name.value; let emailVal = email.value; let mailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; if(!emailVal.match(mailformat) || emailVal=="" || nameVal=="") button.target.classList.toggle("move"); else button.target.classList.add("stop"); })
17th Dec 2022, 10:20 PM
Bob_Li
Bob_Li - avatar
+ 2
Thank You Bob_Li Cause of you I know a different style of email validation.... Thank you so much ๐Ÿ˜‡ for your response
18th Dec 2022, 12:56 AM
Pooja Sahoo
Pooja Sahoo - avatar
+ 1
Can you explain what you are trying to do.
17th Dec 2022, 11:46 AM
Roopesh
Roopesh - avatar