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:
function display_sheet_form($f=array())
{
$count = (isset($f['task_title'])) ? count($f['task_title']) : 3;
if ($count < 3) $count = 3;
echo '<form name="add_sheet" id="dls-sus-modify-sheet" method="post" action="">';
//some additional code here to display the form elements
echo '<input type="hidden" name="mode" value="submitted" />';
echo '<input type="submit" name="Submit" class="button-primary" value="'.esc_attr('Save').'" />';
echo '</form>';
}
I then have another function that I want to do the form processing:
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']) && $_POST['mode'] == 'submitted');
$err = 0;
// Process form if submitted
if($submitted) {
//process the form code
}
}
How can I have the form elements be submitted directly to this function within this class?
EDIT: I included a Pastebin so you can see the whole code: http://pastebin.com/MWJXU1hB