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

Erin's Trek project #20

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Erin's Trek project #20

wants to merge 8 commits into from

Conversation

Erin007
Copy link

@Erin007 Erin007 commented Nov 27, 2016

Waves 1-3

Copy link

@CheezItMan CheezItMan left a 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" >

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

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

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);
})

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants