Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add input validation on index.html to make sure user gives name to new *list* #21

Open
amjcurtis opened this issue Jan 29, 2019 · 0 comments
Assignees

Comments

@amjcurtis
Copy link
Member

amjcurtis commented Jan 29, 2019

Current behavior: If user creates new list w/o giving it a title, currently the new list instance is saved w/ an empty string as its listTitle.

Suggested fix:
Option 1: If user doesn't give new list a name, assign a default name to the list (for example, "Untitled List"). Pros: This is the behavior you'd expect in most apps. Cons: We don't have any functionality for letting user rename an existing list so that they could change it from "Untitled List."

Option 2: If user doesn't give new list a name, alert them to add a name and don't let them move on to next page (lists.html) until they've done so. Pros: This would get around problem of not having any way for user to edit name of an existing list. Cons: None?

Ideas to include:

  • 'required' attribute
  • minLength, maxLength
  • CSS styling like below:
input:invalid {
  box-shadow: 0 0 5px 1px red;
}

input:focus:invalid {
  outline: none;
}
@amjcurtis amjcurtis changed the title Validate user input to make sure user adds listTitle to new list Add input validation on index.html to make sure user adds listTitle to new list Jan 29, 2019
@amjcurtis amjcurtis changed the title Add input validation on index.html to make sure user adds listTitle to new list Add input validation on index.html to make sure user gives name to new list Jan 30, 2019
@amjcurtis amjcurtis changed the title Add input validation on index.html to make sure user gives name to new list Add input validation on index.html to make sure user gives name to new *list* Jan 30, 2019
@amjcurtis amjcurtis self-assigned this Jan 31, 2019
@amjcurtis amjcurtis assigned amjcurtis and cory0s and unassigned amjcurtis Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants