My Survey Page need a bit help with tests

My project: https://codepen.io/maurerlajos1/pen/abmYrRy

Don’t watch the styling yet I want to pass all the tests before adding any additional styling with Css.

My first error is with the name. I didn’t really found any name attribute for input type that get an Html5 validation error. So I used text type and pattern to validate.

<label for="name" id="name-label" >Name</label>
        <input type="text" id="name" placeholder="Mr. Jones"  pattern="[A-Za-z]"></input>

And I don’t know why I get an error for email. I put the emali type into the input tag:

 <label for="email" id="email-label" >Email</label>
       <input type="email" id="email" placeholder="nobody@who.com"></input>

Hi @maurerlajos1,
Add an attribute called ‘required’ inside both input tags (name and email). This will perform the empty field validation and pass those test cases.

1 Like

Thank you very much. Omg just this. I was thinking about validation with patterns and I even thought I write a Javascript validation. I was thinking about this for 2 hours :joy:

@maurerlajos1, in the future when test fail you can click the red button to see which test(s) are failing and text to help you correct the issue. (Be sure and read more than just the first line of the failing message.)

Revisiting this lesson would have given you the answer you needed.

On a side note, don’t use the <br> element to force line breaks or spacing. That’s what CSS is for.

1 Like

Thank you Roma. I read it all the errors after clicking to the red buttons, I was trying to figure it out for 2 hours before asking. Just I misunderstood the error. English is my second language.

I know that’s for CSS just I wanted to pass the tests before I add styling with CSS Gird.