Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6238669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:15:19+00:00 2026-05-24T11:15:19+00:00

I am writing a script where I provide two buttons Grant and Revoke to

  • 0

I am writing a script where I provide two buttons “Grant” and “Revoke” to the user. The problem is that both of them are set and “Grant” button always takes precedence.

Below is Sample code

<form name="form_access" id="form_access" action="" method="POST" class="access">
|
|
| 

<input type="hidden" name="accessaction" value="Grant Access"/>
<input type="hidden" name="revokeaction" value="Revoke Access"/>

<a id="_access_btt" class="button" href="#">Grant Access</a>

    <img class="ajaxload" style="display:none;" id="ajaxld" src="images/ajax-loader.gif"/>
    <a id="_revoke_btt" class="button" href="#">Revoke Access</a>

    <img class="ajaxload" style="display:none;" id="ajaxld1" src="images/ajax-loader.gif"/>
</form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:15:21+00:00Added an answer on May 24, 2026 at 11:15 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am aware that Action Script does not provide multithreading so when writing flex
I am writing a simple script that displays a dialog box when a user
I am writing a script at the moment that will grab certain information from
I'm writing a script that has to move some file around, but unfortunately it
I'm writing a script in PHP that compares people together based on the number
I am writing Perl script. In that I have to read log4j.xml file from
I am writing a script that will look at a directory of Parent VHD
I'm writing a perl script where a should process the text and then provide
Howdy, I'm writing a batch script that will run on a Windows XP machine.
I am writing a fairly simple MVC3 application that allows a user to retrieve

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.