title: New to JavaScript - Need help creating multiple objects with data from a form
body: <p>I just started learning JavaScript and have been stuck on an assignment for about a week now, I've tried several solutions but every time I add something I break something else.
  The assignment is to create a form (which I have completed). The form is to be used to enter data for a new favorite item, when each item is entered it should be displayed on the page and in the console log, as additional items are entered they are added to the list and all items are displayed - </p>
  
  <p>Ex - Favorites are: URL:<a href="http://oriellyschool.com" rel="nofollow">http://oriellyschool.com</a>, title: O'Reilly School, comment: help, tags: school, learning, URL: <a href="http://google.com" rel="nofollow">http://google.com</a>, title: Google, comment: Use google to find info on JavaScript, tags: search, finding info                        faves:html:133</p>
  
  <p>The specific instructions are to use objects for both all favorites and each new favorite item. The functionality to display the favorites (in console and on page) should be included in the methods for the objects.</p>
  
  <p>I am able to get the data from the form into a function and had the function to create the favorites working yesterday, not sure what happened this morning.</p>
  
  <p>If someone could please take a look at this and tell me if I am at least heading in the right direction I would appreciate it. I'm just going in circles now. (I have tons of console.log statements in the code so I could try to see what it was doing).
  Thanks!</p>
  
  <p>Code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>//  Function to create entries for favorite items from web form
  function FaveoriteEntry(url, title, comment, tags) {
    console.log("In Fave Function");
    this.url = url;
    console.log(this.url);
    this.title = title;
    console.log(this.title);
    this.comment = comment;
    console.log(this.comment);
    this.tags = tags;
    console.log(this.tags);
    console.log("Have all items");
  }
  
  //Function to retrieve data from web form and send to function to creat favorite   
  //object.     
  function addFavorite() {
  
    var myFavorites = [];
  
    console.log("In Function");
    var furl = getFavorites.formURL.value;
    var ftitle = getFavorites.formTitle.value;
    var fcomment = getFavorites.formComment.value;
    var ftags = getFavorites.formTags.value;
    this.clear = getFavorites.reset();
    console.log("Entry: " + furl + " " + ftitle + " " + fcomment + " " + ftags);
  
    this.createFavorites = function(url, title, comment, tags) {
      console.log("In Fave Function");
      this.url = url;
      console.log(this.url);
      this.title = title;
      console.log(this.title);
      this.comment = comment;
      console.log(this.comment);
      this.tags = tags;
      console.log(this.tags);
      console.log("Have all items");
      this.string = (this.url + "," + this.title + "," + this.comment + "," +
        this.tags);
      myFavorites.push(this.string);
  
      var addfavorite = new this.createFavorites(furl, ftitle, fcomment,
        ftags);
      console.log(myFavorites);
    }
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
      font-family: Helvetica, Ariel, sans-serif;
  }
  
  form {
      display: table;
      border-spacing: 5px;
  }
  form p {
      display: table-row;
  }
  form label {
      display: table-cell;
      text-align: right;
  }
  form input {
      display: table-cell;
  }
  span.comment {
      font-size: 80%;
      color: #777777;
  }
  span.tags {
      font-size: 80%;
      color: rgb(48, 99, 170);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!doctype html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
    &lt;title&gt;Advanced JavaScript Project: Favorites and Tags&lt;/title&gt;
    &lt;meta charset="utf-8"&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;form name="getFavorites" onsubmit="return favorites(this)"&gt;
      &lt;h1&gt;Tag and save your favorites&lt;/h1&gt;
      &lt;text&gt;&lt;/text&gt;
      &lt;fieldset&gt;
        &lt;legend&gt;Add a new favorite:&lt;/legend&gt;
        &lt;p&gt;
          &lt;label&gt;URL:&lt;/label&gt;
          &lt;input type="text" name="formURL" value="" /&gt;
          &lt;p&gt;
            &lt;label&gt;Title:&lt;/label&gt;
            &lt;input type="text" name="formTitle" value="" /&gt;
          &lt;/p&gt;
          &lt;p&gt;
            &lt;label&gt;Comment:&lt;/label&gt;
            &lt;input type="text" name="formComment" value="" /&gt;
          &lt;/p&gt;
          &lt;p&gt;
            &lt;label&gt;Tags:&lt;/label&gt;
            &lt;input type="text" name="formTags" value="" /&gt;
          &lt;/p&gt;
          &lt;input type="button" name="button" value="Add Link" onClick="addFavorite(this.form)" /&gt;
      &lt;/fieldset&gt;
  
  
  
      &lt;u1 id="faves-lists"&gt;
        &lt;h1&gt; List of Favorites&lt;/h1&gt;
        &lt;li&gt;Test -&lt;/li&gt;
        &lt;p&gt; &lt;span class="comments"&gt;&lt;/span&gt;
        &lt;/p&gt;
        &lt;p&gt; &lt;span class="tags"&gt;&lt;/span&gt;
        &lt;/p&gt;
      &lt;/u1&gt;
  
    &lt;/form&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>