I have 2 functions that makes menu links active/inactive:
function disableCtrl() {
echo 'style="background: #999999;" onclick="return false;"';
}
function enableCtrl() {
echo ' ';
}
I'm using them like this:
<li><a href="#" <?php if (@$_POST['submit']){disableCtrl();} if (@$_GET['guest'] == "add") {enableCtrl();} ?> >MenuButton</a></span></li>
The only problem I have is that menu links must be disabled by default (when the page is loaded).
When I tried to write <?php disableCtrl(); if (@$_POST['submit'])...
, the button became perma-disabled.
Is there a way to make it work, maybe with JavaScript or something else?