title: Calling a function on form submit from within a class
body: <p>I currently am building a class that has some functions defined in it. The first function displays a form for the user to fill out some attributes:</p>
  
  <pre><code>function display_sheet_form($f=array())
  {
  
      $count = (isset($f['task_title'])) ? count($f['task_title']) : 3;
      if ($count &lt; 3) $count = 3;
  
      echo '&lt;form name="add_sheet" id="dls-sus-modify-sheet" method="post" action=""&gt;';
      //some additional code here to display the form elements
      echo '&lt;input type="hidden" name="mode" value="submitted" /&gt;';
      echo '&lt;input type="submit" name="Submit" class="button-primary" value="'.esc_attr('Save').'" /&gt;';
      echo '&lt;/form&gt;';
  }
  </code></pre>
  
  <p>I then have another function that I want to do the form processing:</p>
  
  <pre><code>function modify_sheet_page()
  {
      echo "in the modify sheet page";
      // Set mode vars
      $edit = (empty($_GET['sheet_id'])) ? false : true;
      $add = ($edit) ? false : true;
      $submitted = (isset($_POST['mode']) &amp;&amp; $_POST['mode'] == 'submitted');
      $err = 0;
  
      // Process form if submitted
      if($submitted) {
      //process the form code
      }
  }
  </code></pre>
  
  <p>How can I have the form elements be submitted directly to this function within this class? </p>
  
  <p>EDIT: I included a Pastebin so you can see the whole code:
  <a href="http://pastebin.com/MWJXU1hB" rel="nofollow">http://pastebin.com/MWJXU1hB</a></p>