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
Not Found
Not Found

Submitted

Day 1-5 code challenge

@masha-a-m

Desktop design screenshot for the Intro component with sign-up form coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


This is a repo for Day 1-5 of 20 days of code challenge HerTechTrail. For Day 1-5 we were required to replicate a given sign up form, style it with CSS, make it responsive and also host it.

Users should be able to:

  • sign up with the form
  • Solution URL (https://github.com/masha-a-m/day1-5_20_Days_of_Code_Challenge_HerTechTrail)
  • Live Site URL (https://lucky-biscuit-5c0c3a.netlify.app)

I started this project a week ago. It was a bit hectic for me but with research on different sites, I finally finished it.

  • HTML5 Markup
  • CSS Styling
  • JavaScript

I leant how to make a sign up form with many CSS components

https://codereview.stackexchange.com/questions/114760/student-registration-form

https://stackoverflow.com/questions/20260798/creating-registration-form

Community feedback

@sliyarli

Posted

Your HTML and CSS code looks good for the most part, but I noticed a couple of issues and some room for improvements:

HTML Issues:

1 - In your HTML form, there are missing closing angle brackets (>) for the input elements - For example:

<input type="text" placeholder="First Name" id="first"

Should be:

<input type="text" placeholder="First Name" id="first">

2 - The "Terms and Services" text within the <span> in your HTML should be properly closed with </span> - Update this part:

<p>
    By clicking the button, you are agreeing to our <span> Terms and Services</span>
</p>

To:

<p>
    By clicking the button, you are agreeing to our <span> Terms and Services</span>.
</p>

CSS Issues:

1 - There's a typo in the CSS for the box-sizing property - It should be box-sizing, but you have boz-sizing:

*{
    padding:0;
    margin:0;
    boz-sizing: border-box; /* should be box-sizing */
    font-family: 'Poppins', sans-serif;
}

JavaScript Issues:

1 - There's a typo in your JavaScript code when checking the firstName variable - You have:

var firstname = first.value.trim();

It should be consistent with your variable name:

var firstName = first.value.trim();

2 - In the JavaScript code, you have this block of code duplicated for first name validation:

if (firstName === ''){
    errorFunc(first, 'First Name cannot be empty')
}
else {
    successFunc(first)
}

You should replace the second successFunc(first) with successFunc(last) for the last name validation.

3 - In the successFunc function, you should also remove the success class when an input is in error state - You can do this by using classList.remove('success') in addition to adding the error class.

With these adjustments, your code should work correctly - Make sure to test it thoroughly to ensure everything is functioning as expected.

Marked as helpful

0

@masha-a-m

Posted

thank you so much

0

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