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 8399933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:26:12+00:00 2026-06-09T21:26:12+00:00

I have this two buttons, <?php echo (($active_players >= 25 && !$active_players_check_bypass) ? $html->submit(‘Submit

  • 0

I have this two buttons,

<?php echo (($active_players >= 25 && !$active_players_check_bypass) ? $html->submit('Submit Registration', array('onclick'=>'return window.confirm("You have reached your maximum allowable players per team. In order to register this player, you must pay the $25.00 required overage fee in order to continue. Do you wish to continue with the registration?")')) : $html->submit('Submit Registration'));
  echo $html->submit('Register Player using Registration Credits', array('id'=>'submitregistrationusingcredits')); // this will use the credits of the team
?>

The first button is Submit Registration and the other is Register Player using Registration Credits, now is there a way to know which button I clicked? Im using CakePHP and I am very new to this, is there a way to know which button I clicked so that when validating the form in my controller I will be able to tell what button I clicked and have a process which belongs to each button? Thanks.

  • 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-06-09T21:26:13+00:00Added an answer on June 9, 2026 at 9:26 pm

    I’m not intimately familiar with CakePHP’s HTMl or Form Helper (or whatever you’re using there). However I think if you add a name parameter in the second array argument:

    $html->submit('Register Player using Registration Credits', array('name' => 'usingCredits', 'id' => 'submitregistrationusingcredits'));
    

    Do that for both submit buttons. Then when you are handling that request you can write some code that will look like this:

    if (isset($_POST['usingCredits'])) 
    {
        // handle submission using credits
    } 
    else
    {
        // handle another submission method
    }
    

    You probably want to specify a name for both and check that each name is set. But that’s the idea.

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

Sidebar

Related Questions

I have to send a two-dimensional JavaScript Array to a PHP page. Indeed, I'm
I have a form with two different submit buttons. I take a different action
I have a form with two buttons, a submit button and a cancel/close button.
I have a form with two submit buttons. based on the button clicked i've
Ok so I have two submit buttons, a standard submit button, as well as
I have a very simple form with a name field and two submit buttons:
I have two html text input fields and two buttons. The first button saves
I have this two tables: Table A ID TYPE SDATE EDATE RATING 1 M
I have this two tables from my program to manage stock: Articulos (items): id_articulo
I have this two uls: <ul actualpage=0 id=lastcompanieslist hideable=true upperpage=1> <li page=0 style=display: none;><img

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.