I'm trying to have a button enabled\disabled based on the value of a Boolean the button disabling works however when I try enabling when I require the button to be enabled(after being disabled) it does not work
<?php
if($init==0){
echo "init";
$booleanSubmitDataButtonDisabled= 1;
$booleanGetDataButtonDisabled =0;
}
?>
<?php
if (isset($_POST['getData'])&&!($booleanOwnerId)) {
$actionIsdone =1;
if($actionIsdone){
disableGetDataEnableSubmit();
}
}
function disableGetDataEnableSubmit(){
$init++;
$booleanGetDataButtonDisabled = 1;
$booleanSubmitDataButtonDisabled = 0;
$booleanSelectorDisabled =1;
}
?>
and in my form:
<td><input type="submit" name="getData" value="Get Data For Selected Action"/></td>
<?php if($booleanSubmitDataButtonDisabled){
echo "<td><input type='submit' name='submit' value='Submit' disabled /></td>";
}else{echo "<td><input type='submit' name='submit' value='Submit' /></td>";} ?>
<td><input type="reset" name="reset" value="Clear" <?php if($booleanGetDataButtonDisabled) echo 'disabled="disabled"' ?> /></td>
Am I required to somehow make the html in the page refresh?
I cannot use JavaScript unless this problem absolutely cannot be overcome by using PHP.
Please help with this as I am at my wits end with this problem.
Thanks in advance
Edit: It seems that what I'm trying to achieve cannot be accomplished with PHP, I'll welcome any answer that shows me how to do this simply
Thanks