Code: Select all
// function to cancel
function cancel_form(formName) {
alert(formName.name);
formName.submit();
}Code: Select all
<input type="button" name="submitIt" value="Cancel" onclick="return cancel_form(this.form)">Code: Select all
<?php
// begin switch statment to handle POST request
switch ($_POST['submitIt']) {
case 'Cancel': // if it is being cancelled
echo "submitIt is CANCEL";
break; // ---------- end of cancel case ----------
case 'Submit': // if creating a new one
echo "submitIt is SUBMIT";
break; // ---------- end of create case ----------
default:
echo "submitIt is NOTHING";
}
?>upon submittal. What gives? I've read through php.net about switch statements, but nothing seems wrong there.Notice: Undefined index: submitIt in c:\program files\apache group\apache\htdocs\projects\process_customer_suggestion.php on line 42
submitIt is NOTHING