Having trouble passing The Survey Form/HTML 5 Validation issues

Having trouble passing The Survey Form/HTML 5 Validation issues
0

#1

I’m failing four items on the survey form pen and I’m running into trouble in regard to the following items:

• 8. If I enter non-numbers in the number input, I will see an HTML5 validation error.
• 9. If I enter numbers outside the range of the number input, I will see an HTML5 validation error.’

I’m racking my brain to try and figure out where I’m going wrong with these. Here’s my code:

Insert amount of jigawatts used

The question would be:

  1. Do I need any extra code to generate an HTML5 Validation Error for entering a non-number (or outside-the-range numbers) OR do I just need “required” in the code?

Here’s the URL for my pen:

Thanks a lot for any help you can provide.

Best,
Nick


#2

Can you please link to your Codepen? The link you supplied is just the boilerplate template used for testing.


#3

Here it is


#4

Nope, still the same generic boilerplate. Make sure you save your pen first and then send us the link.


#5

Sorry about that. Here it is.


#6

The id attribute should be unique for the entire document. This means you should only have id=“something” for a single element. See the following section for your duplicate id issue which is causing test #8 and #9 to fail.


#7

I’m having same issue. Not sure if I am doing this right.
Here is my code.

Age:

Is the above code the proper code for User Story #8: If I enter non-numbers in the number input, I will see an HTML5 validation error?


#8

@holmedw
The ID needs to be “number” also. However all else it should be ok.

I would go through your code and check the IDs match all of the cases required for the tests.