Freecodecamp: Give the text input in your form the class form-control.

Created on 20 Sep 2015  路  10Comments  路  Source: freeCodeCamp/freeCodeCamp

Challenge Waypoint: Style Text Inputs as Form Controls has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0.
Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  h2 {
    font-family: Lobster, Monospace;
  }

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

</style>

<div class="container-fluid">
  <div class="row">
    <div class="col-xs-8">
      <h2 class="text-primary text-center">CatPhotoApp</h2>
    </div>
    <div class="col-xs-4">
      <a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
    </div>
  </div>
  <img src="http://bit.ly/fcc-running-cats" class="img-responsive">
  <div class="row">
    <div class="col-xs-4">
      <button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button>
    </div>
    <div class="col-xs-4">
      <button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i> Info</button>
    </div>
    <div class="col-xs-4">
      <button class="btn btn-block btn-danger"><i class="fa fa-trash"></i> Delete</button>
    </div>
  </div>
  <p>Things cats <span class="text-danger">love:</span></p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
  <form  action="/submit-cat-photo">
    <div class="row">
      <div class="col-xs-6">
        <label><input type="radio" name="indoor-outdoor"> Indoor</label>
      </div>
      <div class="col-xs-6">
        <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-4">
        <label><input type="checkbox" name="personality"> Loving</label>
      </div>
      <div class="col-xs-4">
        <label><input type="checkbox" name="personality"> Lazy</label>
      </div>
      <div class="col-xs-4">
        <label><input type="checkbox" name="personality"> Crazy</label>
      </div>
    </div>
    <input type="text" placeholder="cat photo URL" required>
  <form class="form-control">
    <div>
        <button class="btn btn-primary" type="submit">Submit<i class="fa fa-paper-plane"></i> </button>
    </div>
    </form>
    </form>
</div>

Most helpful comment

input type="text" class="form-control" placeholder="cat photo URL" required>

All 10 comments

There seems to be an error in your code.. the directions are to give the input element of type text the class of form-control There is no need to create a separate form to go around the button as both the input and button are in a form. Hope this helps @vvkgdm!

@vvkgdm thanks for posting this issue!
@natac13 is correct. You should remove the new form element and add form-control class to <input type="text" placeholder="cat photo URL" required>.
Closing this issue. If you have problems with your code, please, post a message in our Gitter chat room first, thanks.


Please review the Guidelines for Contributing, thank you!.


input type="text" class="form-control" placeholder="cat photo URL" required>

@natac13 Really an intelligent person
May you succeed in your aim

Glad my answer helped you @hamadjadoon. I really appreciate the feedback!

Thanks guys.

it helps me, thank you

<div class="btn btn-primary"><input type="text" class="form-control" placeholder="cat photo URL" required><button type="submit"><i class="fa fa-paper-plane">Submit</i></button></div>

Give the submit button in your form the classes btn btn-primary. Why is this error there ?

@esaky you should add the btn class to the button nest:
removed solution by mod

Was this page helpful?
0 / 5 - 0 ratings