-
Notifications
You must be signed in to change notification settings - Fork 45
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
Erin's Trek project #20
base: master
Are you sure you want to change the base?
Conversation
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.
Not bad! Just a few small details, but overall quite well done.
<p id="about"> </p> | ||
<h3 id="reserve">✔︎ Reserve a spot</h3> | ||
|
||
<form action="https://trektravel.herokuapp.com/trips/" method="POST" id = "reservation-form" > |
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.
ideally I'd wrap the form in some sort of container.
var callback = function(){ | ||
console.log("Success!") | ||
alert("You've successfully reserved a spot!"); | ||
//and takes you back to the trips page |
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.
the alert is a little annoying.
//and takes you back to the trips page | ||
$('#trip-details').toggle(); | ||
$('#trips').toggle(); | ||
//and clears the data from the form and hides it again |
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 use of jQuery toggle
var reserveURL = url + "/" + $('#id').text() + "/reserve" | ||
var formData = $(this).serialize(); | ||
$.post(reserveURL, formData, callback); | ||
}) |
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.
What about when an error occurs?
Waves 1-3