title: Firebase: How to set:node Foreach input field
body: <p>This is for a Polls web app.<br>
  <a href="http://i.stack.imgur.com/czTVT.png" rel="nofollow">Polls App</a><br>
  <strong>What I want:</strong> </p>
  
  <ul>
  <li>When the "Create Polls" button is hit, Firebase takes a push (Creating a unique ID).</li>
  <li>This unique ID (example:<code>-KBAi-3yaROWfzdmuFk5</code>) has a child <code>poll: "Do you like Pina Coladas?"</code>- from the question input field.</li>
  <li>The <code>poll:</code> node then gets child <code>Choices:</code></li>
  <li>The <code>Choices:</code> node has a child of every choice (from input fields) </li>
  <li>Every choice node has a child <code>vote_count: 0</code> 
  
  <ul>
  <li><code>.set({ vote_count: 0 });</code></li>
  </ul></li>
  </ul>
  
  <pre class="lang-js prettyprint-override"><code>var myDataRef = new Firebase('https://...firebaseio.com/');
  
  // CLICK Add NEW POLL / Check to see if Poll has Name &amp; least 2 responses
  $( "#PollCreate" ).click(function add() {
    var name = $('#pollQuestion').val();
    var text = $('#text1').val();
    var text2 = $('#text2').val();
    if(name != '' &amp;&amp; text != '' &amp;&amp; text2 != '') {
      var newPostRef = myDataRef.push();
      newPostRef.set({ poll: name });
  
      $("#choices :input").each(function() {
        var input = $(this).val();
        // check if added choices are Null
        if( input != '') {
          var newPostRef = myDataRef.push();
          newPostRef.child().set({ choice: input }).set({ vote_count: 0
                                                        });
          console.log(input);
        }
        $(this).val('');
      });
    } else { $('.input_Error').show(); }
  });
  </code></pre>
  
  <p>I don't know if this structure is the best for this. I'm totally open to other ideas.<br>
  I also need to be able to get the data back out.<br>
  <a href="http://i.stack.imgur.com/Fvls4.png" rel="nofollow">What I can get (Firebase Structure)</a></p>