I need help on number 9#
I have already added min and max so I do not understand what else it wants
I have read the extra and I still do not understand
https://codepen.io/leahec_lescra/pen/LYWjYRO
9. #If I enter numbers outside the range of the number input, I will see an HTML5 validation error.'
@lce2465we, the full error message says
If I enter numbers outside the range of the number input, I will see an HTML5 validation error.'
Minimum number should be defined : expected NaN not to be NaN
AssertionError: Minimum number should be defined : expected NaN not to be NaN
The message is saying you do not have a minimum number defined. (NaN means Not a Number)
Looking at your code
<input name="number" type="number" id="number" class="input1" placeholder="Speak here" required min:"1" max:"20" required>
Do you have the min
and max
attributes defined correctly?
EDIT:
There are a few other places where you have incorrect syntax for attributes. Along with other errors.
Run your HTML code through the W3C validator.
@lce2465we, another thing I noticed is you have nested form
elements. This is not allowed.
Search for html form elements to see what elements are valid within the form
element. (The first hit using Google is good)
So I change the form elements to something different?
Yes, you should only have one form
element that encompasses all the other elements within that form.
For instance, you can nest the input
element within the ‘label’ element (remember that lesson?) and then nest that in a div
element.
Don’t forget to close your one form
element and remember, an input
is self-closing. It doesn’t require a closing tag.
Something that may help. You can switch the Syntax Highlighting on Codepen to help catch errors. Go to your Codepen profile settings (not the setting for the pen, but for your profile). Switch the Syntax Highlighting to Oceanic Dark and save the setting. Go back to the pen and make sure your new setting is working. The code highlighting will be using different colors. Errors will now be marked in red.
Can I put completely different types of html forms? Or do they all have to be the same?I only need two forms
You only need one form. You can have multiple inputs inside that form, of whatever types you need.
@lce2465we, as @kevinSmith noted you only need one form. Within that form
element will be all the other elements you need to complete this project successfully.
As I mentioned earlier, you can search for html form elements to see what elements are valid within the form
element.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.