I apologize if this not the right place for this, however I felt I should post here since it is related to PHP.
I have a form, with a submit button.
<?
session_start();
?>
<form id="frmAddAccount" method="post" action="process.php">
<input id="btnAddAccount" type="submit" value="submit">
</form>
Process.php looks like this:
<?
session_start();
$q = '';
if (isset($_POST['btnAddAccount'])) {
// Add Account
$q = 'AddAccount'; // return to add account page
}
$str = 'index.php?q='.$q;
header("Location: $str");
?>
When I submit the form, everything happens correctly. However, I then added the javascript to disable the submit button on the form. In fact, I've tried several methods, but they all yield the same results. The button disables correctly, but the $_POST['btnAddAccount'] is not set when process.php comes about.
<?
session_start();
?>
<form id="frmAddAccount" method="post" action="process.php">
<input id="btnAddAccount" type="submit" value="submit" onClick="this.disabled=true" />
</form>
Does anyone have any idea what is going on, and/or any suggestions?
Edit: Also please note that the above code is highly simplified, but I feel it includes all the pertinent information.
I will add though, that process.php is a global form handler, and that is why it checks to see if a particular button ID is set, so it knows what form handler to pass the data off to (via include 'formxyz_proc.php')
The main purpose of that is to help conceal the internal mechanics from clients, and secondarily for modularity.