title: Form Responses Changing Values
body: <p>I am trying to make it so that when you submit my form - if you type 'Martin' in first name, 'Neuhard' in last name, and select 'Binghamton University' in the dropdown it changes the background green and pops up a pitcure of binghamton university. It works if i use || but not when i use &amp;&amp;. </p>
  
  <p>Also i want to make it so that if the two email field aren't the same then alert('error')</p>
  
  <p>I've been trying for hours and cannot figure it out. the jsfiddle is below</p>
  
  <p><a href="http://jsfiddle.net/esaunde1/ngjo8aoq/" rel="nofollow">http://jsfiddle.net/esaunde1/ngjo8aoq/</a></p>
  
  <p>HTML</p>
  
  <pre><code>        &lt;div class="container" id='contact'&gt;
          &lt;div class="row"&gt;
            &lt;div class="col-md-8 col-md-offset-2"&gt;
              &lt;div class="well well-sm"&gt;
                &lt;form class="form-horizontal" action="send_form_email.php" method="post"&gt;
                &lt;fieldset&gt;
                  &lt;legend class="text-center"&gt;Get in touch!&lt;/legend&gt;
  
                  &lt;div class="form-group"&gt;
                    &lt;label class="col-xs-4 control-label" for="name"&gt;First Name&lt;/label&gt;
                    &lt;div class="col-xs-8"&gt;
                      &lt;input id="name" name="name" type="text" placeholder="Your first name" data-    trigger="manual" data-content="Can only contain letters!" class=" form-control" pattern="[A-Za-z]+" type="text" required&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
  
                  &lt;div class="form-group"&gt;
                    &lt;label class="col-xs-4 control-label" for="lname"&gt;Last Name&lt;/label&gt;
                    &lt;div class="col-xs-8"&gt;
                      &lt;input id="lname" name="lname" type="text" placeholder="Your last name" data-trigger="manual" data-content="Can only contain letters!" class="name form-control" type="text" required pattern="[A-Za-z]+"&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
  
  
                  &lt;div class="form-group"&gt;
                    &lt;label class="col-xs-4 control-label" for="email"&gt;E-mail Address&lt;/label&gt;
                    &lt;div class="col-xs-8"&gt;
                      &lt;input id="email" name="email" type="email" placeholder="What's your email?" class="email form-control" data-placement="top" data-trigger="manual" data-content="Must be a valid e-mail address" type="text" email required&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
  
                  &lt;div class="form-group"&gt;
                    &lt;label class="col-xs-4 control-label" for="emailCheck"&gt;E-mail Address&lt;/label&gt;
                    &lt;div class="col-xs-8"&gt;
                      &lt;input id="emailCheck" name="emailCheck" type="email" placeholder="What's your email?" class="email form-control" data-placement="top" data-trigger="manual" data-content="Must be a valid e-mail address" type="text" email required&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
  
                  &lt;div class="form-group"&gt;
                    &lt;label class="col-xs-4 control-label" for="email"&gt;Your Phone Number&lt;/label&gt;
                    &lt;div class="col-xs-8"&gt;
                      &lt;input id="email" name="email" placeholder="What is your phone number?" class="form-control phone" data-placement="top" data-trigger="manual" data-content="Must be a valid phone number" type="text" pattern="[0-9]+" required&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
  
                   &lt;div class="form-group"&gt;
                      &lt;label class='col-xs-4 control-label'&gt;What school do you go to?&lt;/label&gt;
                      &lt;div class='col-xs-8'&gt;
                          &lt;select class="form-control" id='dropdown'&gt;
                            &lt;option&gt;Select One&lt;/option&gt;
                            &lt;option&gt;The College of NJ&lt;/option&gt;
                            &lt;option&gt;Rutgers University&lt;/option&gt;
                            &lt;option&gt;Columbia University&lt;/option&gt;
                            &lt;option value="bing"&gt;Binghamton University&lt;/option&gt;
                          &lt;/select&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
  
                  &lt;div class="form-group"&gt;
                    &lt;div class="col-md-12"&gt;
  
                      &lt;input class="btn btn-primary" value="Check Form" onClick='return valid()'&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
  
                &lt;/fieldset&gt;
                &lt;/form&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>JAVASCRIPT</p>
  
  <pre><code>function valid(){   
  
  var name = document.getElementById('name');
  var lname = document.getElementById('lame');
  var home = document.getElementById('home');
  
      if (name.value == 'Martin' &amp;&amp; lname.value == 'Neuhard' &amp;&amp; ){
          $('#home').addClass('green');
          $('#contact').addClass('image');
  
          }
      else if (document.getElementById('first').value == 'martin'){
          alert('thats our profs name!')
      }
      else return false;
  </code></pre>
  
  <p>}</p>