447072 (1) [Avatar] Offline
#1
Page 239
Section 7.5.3
Listing 7.26

I am unable to get the JQuery mentioned to Alert when the Review Fields are blank.

I downloaded Chapter 7 and my code looks the same.

Instructions read: "For this to work we need to ensure that the form has an ID of addReview set so that the
jQuery can listen for the correct event."
- where is this done?

FYI - so far this has been a fantastic tutorial.

Jun (2) [Avatar] Offline
#2
In location-review-form.jade, I added it to line 9:

extends layout

block content
  .row.page-header
    .col-lg-12
      h1= pageHeader.title
  .row
    .col-xs-12.col-md-6
      form#addReview.form-horizontal(action="", method="post", role="form")
        - if (error == "val")
          .alert.alert-danger(role="alert") All fields required, please try again
        .form-group
          label.col-xs-10.col-sm-2.control-label(for="name") Name
          .col-xs-12.col-sm-10
            input#name.form-control(name="name")
        .form-group
          label.col-xs-10.col-sm-2.control-label(for="rating") Rating
          .col-xs-12.col-sm-2
            select#rating.form-control.input-sm(name="rating")
              option 5
              option 4
              option 3
              option 2
              option 1
        .form-group
          label.col-sm-2.control-label(for="review") Review
          .col-sm-10
            textarea#review.form-control(name="review", rows="5")
        button.btn.btn-default.pull-right Add my review
    .col-xs-12.col-md-4