Submit form with success message

Please log in to post a comment
Log in with GitHubCommunity feedback
- @sanju321GH
yo hi, i think there is a mistake in you code i mean the code is just checking for "@" and "g" but not "mail.com" when i typed "wd@g" it worked. to avoid this you could do this
JS-
let gmailholder; document.getelementbyID("btn").onclick = function(){ gmailholder = document.getelementbyID("inputfield").value; let gmail = gmailholder; //i dont know y but if i dont write this code it gives me error let gmailchecker = slice(gmail.indexof("@")); if(gmailchecker == "@gmail.com"){ (give them the result) } else{ (give them the error) }
}
hope you dont make the mistake you have made now in the future.😊 also keep it up👍
Marked as helpful - P@enzo-mir
You use "gmail" only for this line of code :
- let gmailchecker = slice(gmail.indexof("@")); ^ Maybe just get "gmailholder"'s slice as the declaration of "gmail" is "gmailholder" :
- let gmailchecker = slice(gmailholder.indexof("@"));
Else if good job !!
Marked as helpful
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord