-
Notifications
You must be signed in to change notification settings - Fork 44
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
Stef -- Carets #34
base: master
Are you sure you want to change the base?
Stef -- Carets #34
Conversation
… details properly.
…ey are clicked on when sorting.
…othing but parsing errors.
…eating a reservation.
…on the idea of initializing...
… the life of me get any messages to be cooperative so all my users will have to use the console.
BackTREKWhat We're Looking For
|
}); | ||
} else { | ||
console.log('Trip is invalid, sad trombone.'); | ||
console.log(trip.validationError); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good that you're checking validation errors, but this needs to be reported to the user as well.
$('#status-messages ul').empty(); | ||
console.log(response.responseJSON.errors); | ||
|
||
for(let key in response.responseJSON.errors) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, good to use for letting the user know the validation error issues.
|
||
<form id="reservation-trip-form" method="post"> | ||
<label for="name">Full Name</label> | ||
<input type="text" name="name"></input> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't being selected by app.js
Because it's having trouble with $('input[name="name"]')
Instead an alternative way of being selected would be appropriate, an id etc.
event.preventDefault(); | ||
const tripData = {}; | ||
fields.forEach( (field) => { | ||
const val = $(`input[name=${field}]`).val(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't working for the name field.
BackTREK
Congratulations! You're submitting your assignment!
Comprehension Questions