Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Request path contains unescaped characters
Not Found

Submitted

Responsive landing page using flex, tailwindcss and javaScript

@suruaino

Desktop design screenshot for the Base Apparel coming soon page coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I notice that trying to open my screenshots from the README always load into an error page. Please what am I doing wrong?

Can someone also please hint me on proper form validation with JavaScript?

Community feedback

Aimal Khan 2,260

@Aimal-125

Posted

Use this js code for validation:-


let regex = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;

function myfunc() {
if(x.value == "") {
y.style.visibility = "visible";
y.innerHTML = "Empty Field";
y.style.color = "hsl(0, 74%, 74%)";
q.style.border = "2px solid hsl(0, 74%, 74%)";
a.style.visibility = "visible";
}
else if(!(x.value.match(regex))) {
y.style.visibility = "visible";
y.innerHTML = "Please provide a valid email";
y.style.color = "hsl(0, 74%, 74%)";
q.style.border = "2px solid hsl(0, 74%, 74%)";
a.style.visibility = "visible";
}
else if(x.value.match(regex)) {
y.style.visibility = "visible";
y.innerHTML = "Valid email";
y.style.color = "green";
q.style.border = "1px solid hsl(0, 6%, 24%)";
a.style.visibility = "hidden";
}
}

z.addEventListener("click", myfunc);

where z is the pink button. y is the red error image. q is the div in which input element is. x is input type text. a is the p element in which error msg will display.

Marked as helpful

0

@suruaino

Posted

wow, that a whole lot of information. Thanks, I really appreciate.@Aimal-125

0

@javascriptor1

Posted

Hello Suru ,

Please check my solution where you can find validation for email in Javascript.

Usually , a regular expression pattern is made then we check user input againt our pattern.

Marked as helpful

0

@matiasluduena23

Posted

Hi @suruaino! good work!

Your image is not in your code folder, put it in a folder and push again to github. And also use a .jpg image

Good luck!

0

@suruaino

Posted

Honestly I observed that too. I don't know while the image folder is always skipped when I push them together. I will try and find my way around it though. Thanks for your observation. @matiasluduena23

0

@Aazeez257

Posted

Hello @suruaino, try uploading the screenshot to the same file location as the readme file example - screenshot.png not like this images/screenshot.png😊😉

0

@suruaino

Posted

Okay, Thanks. I will try that. @Aazeez257

1

Please log in to post a comment

Log in with GitHub
Discord logo

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