title: How to create persist function on checkbox if data is present
body: <p>I have seen many checkbox examples, but not this one.  </p>
  
  <p>I need a checkbox to remain checked if data is present in specific <code>&lt;input&gt;</code> fields. So it would need to be something that is constantly checking field status. </p>
  
  <p>Basic checkbox:</p>
  
  <pre><code>&lt;input class="checkbox" type="checkbox" unchecked onclick="shipping()"/&gt;
  </code></pre>
  
  <p>It calls a function that removes a <code>&lt;div&gt;</code> and adds a shipping info page.  There is a back button there that will remove shipping page and add orig.  If they entered shipping data I want that checkbox to be checked. Now if they click it again, the data they entered on the shipping page would disappear.  And process can be repeated.</p>
  
  <p>This is a PHP page so I am comfortable using javascript, jQuery or PHP.  Just looking for the most reliable way.</p>