Rather than using two hidden elements, Why dont you use a single hidden element, something like this?
for example: you could use:
<input type="hidden" name="accessPermission" value=""/>
and depending upon what button user clicks, with the help of javascript you could set this action's value too:
document.form_access.accessPermission.value = "Revoke Access"
and
document.form_access.accessPermission.value = "Grant Access"
and then submit the form!
so in the end, you can just check value $_REQUEST['accessPermission'] in your PHP,
and you will get whatever value you have set for your hidden form element accessPermission:
if its value is Revoke Access you will get $_REQUEST['accessPermission'] as 'Revoke Access'
if its value is Grant Access you will get $_REQUEST['accessPermission'] as 'Grant Access'
So at the end, you can construct your form as:
<form name="form_access" id="form_access" action="" method="POST" class="access">
|
|
|
<input type="hidden" name="accessPermission" value=""/>
<a id="_access_btt" class="button" href="javascript:document.form_access.accessPermission.value = 'Grant Access'">Grant Access</a>
<img class="ajaxload" style="display:none;" id="ajaxld" src="images/ajax-loader.gif"/>
<a id="_revoke_btt" class="button" href="javascript:document.form_access.accessPermission.value = 'Revoke Access'">Revoke Access</a>
<img class="ajaxload" style="display:none;" id="ajaxld1" src="images/ajax-loader.gif"/>
</form>
And Both the values are set because, its really specifically set by the lines:
<input type="hidden" name="accessaction" value="Grant Access"/>
<input type="hidden" name="revokeaction" value="Revoke Access"/>
Grant Action takes precedence, because that's appears first.