London | 26-ITP-Jan | Abdul Moiz | Sprint 3 | Alarm Clock#958
London | 26-ITP-Jan | Abdul Moiz | Sprint 3 | Alarm Clock#958A-Moiz wants to merge 2 commits intoCodeYourFuture:mainfrom
Conversation
Sprint-3/alarmclock/index.html
Outdated
There was a problem hiding this comment.
You could look into preventing negative input (-1 or lower) and update the Javascript file to prevent your alarm clock from taking negative input
There was a problem hiding this comment.
I added min='1' in the HTML so it doesn't allow 0 or negatives. I don't think any changes in JavaScript would be required after this. If changes in JavaScript file are still needed after this please let me know why that would be the case. Thanks.
There was a problem hiding this comment.
Thank you @A-Moiz. The min attribute in the HTML is a great start to ensuring input is better and clean. The change suggested would be a step to ensure form validation is maintained and good. You could look into form validation to ensure bad input isn't passed/taken but other than that, the code looks good for a start.
There was a problem hiding this comment.
Hi @codeschris, could you please clarify what else would be needed for it to be completed? With the addition of min='1' values that are less than or equal to 0 aren't allowed/passed.
There was a problem hiding this comment.
The min attribute is the first (and primary best) step to ensuring that negative input isn't taken in. The addition to the Javascript file ensures that wrong input isn't passed and stopping the timer from working. Check the first approach here and see how you could validate the input in your application. The work is complete but this is more of a best practice/approach that you could use in later projects and assignments.
Learners, PR Template
Self checklist
Changelist
Questions
N/A