Pass additional data with submit button










1















I have form, with two buttons:






 <form action="/Book/Crud" method="post">
<input type="text" name="bookInput" />
<button type="submit">Save</button>
<button type="submit">Save and exit</button>
</form>





How can I pass to my controller, or, whatever, additional value, which depends on button?
<button type="submit" ?????? >Save</button> What should be here?



I am using Asp.Net Core, with this controller:



public IActionResult Crud(string bookInput)

//removed code for brevity










share|improve this question
























  • Please add more information; add backend (C#, Wordpress, "IDontKnow"), what controller? what server? etc etc

    – Leon
    Jun 22 '16 at 16:21











  • @Leon edited question.

    – Yurii N.
    Jun 22 '16 at 16:26















1















I have form, with two buttons:






 <form action="/Book/Crud" method="post">
<input type="text" name="bookInput" />
<button type="submit">Save</button>
<button type="submit">Save and exit</button>
</form>





How can I pass to my controller, or, whatever, additional value, which depends on button?
<button type="submit" ?????? >Save</button> What should be here?



I am using Asp.Net Core, with this controller:



public IActionResult Crud(string bookInput)

//removed code for brevity










share|improve this question
























  • Please add more information; add backend (C#, Wordpress, "IDontKnow"), what controller? what server? etc etc

    – Leon
    Jun 22 '16 at 16:21











  • @Leon edited question.

    – Yurii N.
    Jun 22 '16 at 16:26













1












1








1








I have form, with two buttons:






 <form action="/Book/Crud" method="post">
<input type="text" name="bookInput" />
<button type="submit">Save</button>
<button type="submit">Save and exit</button>
</form>





How can I pass to my controller, or, whatever, additional value, which depends on button?
<button type="submit" ?????? >Save</button> What should be here?



I am using Asp.Net Core, with this controller:



public IActionResult Crud(string bookInput)

//removed code for brevity










share|improve this question
















I have form, with two buttons:






 <form action="/Book/Crud" method="post">
<input type="text" name="bookInput" />
<button type="submit">Save</button>
<button type="submit">Save and exit</button>
</form>





How can I pass to my controller, or, whatever, additional value, which depends on button?
<button type="submit" ?????? >Save</button> What should be here?



I am using Asp.Net Core, with this controller:



public IActionResult Crud(string bookInput)

//removed code for brevity






 <form action="/Book/Crud" method="post">
<input type="text" name="bookInput" />
<button type="submit">Save</button>
<button type="submit">Save and exit</button>
</form>





 <form action="/Book/Crud" method="post">
<input type="text" name="bookInput" />
<button type="submit">Save</button>
<button type="submit">Save and exit</button>
</form>






html asp.net-core






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 22 '16 at 16:31







Yurii N.

















asked Jun 22 '16 at 16:19









Yurii N.Yurii N.

1,99421843




1,99421843












  • Please add more information; add backend (C#, Wordpress, "IDontKnow"), what controller? what server? etc etc

    – Leon
    Jun 22 '16 at 16:21











  • @Leon edited question.

    – Yurii N.
    Jun 22 '16 at 16:26

















  • Please add more information; add backend (C#, Wordpress, "IDontKnow"), what controller? what server? etc etc

    – Leon
    Jun 22 '16 at 16:21











  • @Leon edited question.

    – Yurii N.
    Jun 22 '16 at 16:26
















Please add more information; add backend (C#, Wordpress, "IDontKnow"), what controller? what server? etc etc

– Leon
Jun 22 '16 at 16:21





Please add more information; add backend (C#, Wordpress, "IDontKnow"), what controller? what server? etc etc

– Leon
Jun 22 '16 at 16:21













@Leon edited question.

– Yurii N.
Jun 22 '16 at 16:26





@Leon edited question.

– Yurii N.
Jun 22 '16 at 16:26












5 Answers
5






active

oldest

votes


















1














You can use jquery to solve the issue:



cshtml



<form action="/Book/Crud" method="post">
<input type="text" name="bookInput" />
<button type="submit" name="Submit">Save</button>
<button type="submit" name="SubmitAndExit">Save and exit</button>
</form>


jquery



$("form").submit(function () 
var btn = $(this).find("input[type=submit]:focus" );
var btnName = btn.attr('name');
var input = $("<input>")
.attr("name", "btnName").val(btnName);
$(this).append(input);
return true;
);





share|improve this answer























  • That's the answer, the only remark is that "button[type=submit]:focus" instead of "input[type=submit]:focus".

    – Yurii N.
    Jun 23 '16 at 8:10











  • Also, what should we do with created nameless input?

    – Yurii N.
    Jun 23 '16 at 9:44


















1














<form action="/Book/Crud" method="post">
<input type="text" name="bookInput" />
<button name="action" value="save" type="submit">Save</button>
<button name="action" value="save-exit" type="submit">Save and exit</button>
</form>


Like other inputs, the button can have a name and value attribute which will be submitted to your backend on submit. Only the button that was clicked will send its value. You need to use whatever mechanism you're using to access the POSTed variable named action (in this example). Then just switch on whether it's equal to save or save-exit and perform the relevant function.






share|improve this answer























  • The same question: how can I catch difference between those two buttons on server side?

    – Yurii N.
    Nov 22 '17 at 7:13











  • @YuriyN. Look at the value of the POSTed variable named action. If it's "save", the "Save" button was pressed. If it's "save-exit", the "Save and exit" button was pressed.

    – Bobby Jack
    Nov 23 '17 at 9:31











  • I'm not sure how can I do this at ASP.NET Core, could you explain please?

    – Yurii N.
    Nov 23 '17 at 9:35











  • I don't know asp.net, I'm afraid. Are you not already processing the 'bookInput' value? It should be the exact same procedure.

    – Bobby Jack
    Nov 23 '17 at 10:13











  • Yes, it is already processed, but this processing is already built-in ASP.NET Core, about processing button's value, I'm not sure.

    – Yurii N.
    Nov 23 '17 at 10:27


















1














The answer of Bobby Jack is correct. I will elaborate on this answer in order to show how to access this input from within the controller. If you would use the following HTML:



<form action="/Book/Crud" method="post">
<input type="text" name="bookInput" />
<button name="action" value="save" type="submit">Save</button>
<button name="action" value="save-exit" type="submit">Save and exit</button>
</form>


You could reach the values: 'save' and 'save-exit' by defining another parameter in the controller like this:



// The parameter 'action' is what will contain the values specified in the button.
public IActionResult Crud(string bookInput, string action)

// Implementation



The name of the parameter needs to correspond to the value in the 'name' attribute of the form button (in this case 'action'). When the button is clicked, ASP.net will automatically assign the value of the 'value' attribute to the controller parameter. Or more specifically the controller parameter 'action' will have a value of 'save' or 'save-exit' retrieved from the attribute 'value'.






share|improve this answer























  • Hello, thanks for the additional clarification!

    – Yurii N.
    Nov 12 '18 at 19:55


















0














add different names



<button type="submit" name="save">Save</button>
<button type="submit" name="saveExit">Save and exit</button>





share|improve this answer


















  • 2





    And how can I catch difference between this buttons?

    – Yurii N.
    Jun 22 '16 at 16:28


















0














Example from VB.net:



<asp:Button id="cmdKeyphraseAdd" runat="server" Text="Add Keyphrase" onclick="cmdKeyphraseAdd_Click"></asp:Button>





share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f37973455%2fpass-additional-data-with-submit-button%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    5 Answers
    5






    active

    oldest

    votes








    5 Answers
    5






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    You can use jquery to solve the issue:



    cshtml



    <form action="/Book/Crud" method="post">
    <input type="text" name="bookInput" />
    <button type="submit" name="Submit">Save</button>
    <button type="submit" name="SubmitAndExit">Save and exit</button>
    </form>


    jquery



    $("form").submit(function () 
    var btn = $(this).find("input[type=submit]:focus" );
    var btnName = btn.attr('name');
    var input = $("<input>")
    .attr("name", "btnName").val(btnName);
    $(this).append(input);
    return true;
    );





    share|improve this answer























    • That's the answer, the only remark is that "button[type=submit]:focus" instead of "input[type=submit]:focus".

      – Yurii N.
      Jun 23 '16 at 8:10











    • Also, what should we do with created nameless input?

      – Yurii N.
      Jun 23 '16 at 9:44















    1














    You can use jquery to solve the issue:



    cshtml



    <form action="/Book/Crud" method="post">
    <input type="text" name="bookInput" />
    <button type="submit" name="Submit">Save</button>
    <button type="submit" name="SubmitAndExit">Save and exit</button>
    </form>


    jquery



    $("form").submit(function () 
    var btn = $(this).find("input[type=submit]:focus" );
    var btnName = btn.attr('name');
    var input = $("<input>")
    .attr("name", "btnName").val(btnName);
    $(this).append(input);
    return true;
    );





    share|improve this answer























    • That's the answer, the only remark is that "button[type=submit]:focus" instead of "input[type=submit]:focus".

      – Yurii N.
      Jun 23 '16 at 8:10











    • Also, what should we do with created nameless input?

      – Yurii N.
      Jun 23 '16 at 9:44













    1












    1








    1







    You can use jquery to solve the issue:



    cshtml



    <form action="/Book/Crud" method="post">
    <input type="text" name="bookInput" />
    <button type="submit" name="Submit">Save</button>
    <button type="submit" name="SubmitAndExit">Save and exit</button>
    </form>


    jquery



    $("form").submit(function () 
    var btn = $(this).find("input[type=submit]:focus" );
    var btnName = btn.attr('name');
    var input = $("<input>")
    .attr("name", "btnName").val(btnName);
    $(this).append(input);
    return true;
    );





    share|improve this answer













    You can use jquery to solve the issue:



    cshtml



    <form action="/Book/Crud" method="post">
    <input type="text" name="bookInput" />
    <button type="submit" name="Submit">Save</button>
    <button type="submit" name="SubmitAndExit">Save and exit</button>
    </form>


    jquery



    $("form").submit(function () 
    var btn = $(this).find("input[type=submit]:focus" );
    var btnName = btn.attr('name');
    var input = $("<input>")
    .attr("name", "btnName").val(btnName);
    $(this).append(input);
    return true;
    );






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jun 22 '16 at 17:42









    adem caglinadem caglin

    10.1k52950




    10.1k52950












    • That's the answer, the only remark is that "button[type=submit]:focus" instead of "input[type=submit]:focus".

      – Yurii N.
      Jun 23 '16 at 8:10











    • Also, what should we do with created nameless input?

      – Yurii N.
      Jun 23 '16 at 9:44

















    • That's the answer, the only remark is that "button[type=submit]:focus" instead of "input[type=submit]:focus".

      – Yurii N.
      Jun 23 '16 at 8:10











    • Also, what should we do with created nameless input?

      – Yurii N.
      Jun 23 '16 at 9:44
















    That's the answer, the only remark is that "button[type=submit]:focus" instead of "input[type=submit]:focus".

    – Yurii N.
    Jun 23 '16 at 8:10





    That's the answer, the only remark is that "button[type=submit]:focus" instead of "input[type=submit]:focus".

    – Yurii N.
    Jun 23 '16 at 8:10













    Also, what should we do with created nameless input?

    – Yurii N.
    Jun 23 '16 at 9:44





    Also, what should we do with created nameless input?

    – Yurii N.
    Jun 23 '16 at 9:44













    1














    <form action="/Book/Crud" method="post">
    <input type="text" name="bookInput" />
    <button name="action" value="save" type="submit">Save</button>
    <button name="action" value="save-exit" type="submit">Save and exit</button>
    </form>


    Like other inputs, the button can have a name and value attribute which will be submitted to your backend on submit. Only the button that was clicked will send its value. You need to use whatever mechanism you're using to access the POSTed variable named action (in this example). Then just switch on whether it's equal to save or save-exit and perform the relevant function.






    share|improve this answer























    • The same question: how can I catch difference between those two buttons on server side?

      – Yurii N.
      Nov 22 '17 at 7:13











    • @YuriyN. Look at the value of the POSTed variable named action. If it's "save", the "Save" button was pressed. If it's "save-exit", the "Save and exit" button was pressed.

      – Bobby Jack
      Nov 23 '17 at 9:31











    • I'm not sure how can I do this at ASP.NET Core, could you explain please?

      – Yurii N.
      Nov 23 '17 at 9:35











    • I don't know asp.net, I'm afraid. Are you not already processing the 'bookInput' value? It should be the exact same procedure.

      – Bobby Jack
      Nov 23 '17 at 10:13











    • Yes, it is already processed, but this processing is already built-in ASP.NET Core, about processing button's value, I'm not sure.

      – Yurii N.
      Nov 23 '17 at 10:27















    1














    <form action="/Book/Crud" method="post">
    <input type="text" name="bookInput" />
    <button name="action" value="save" type="submit">Save</button>
    <button name="action" value="save-exit" type="submit">Save and exit</button>
    </form>


    Like other inputs, the button can have a name and value attribute which will be submitted to your backend on submit. Only the button that was clicked will send its value. You need to use whatever mechanism you're using to access the POSTed variable named action (in this example). Then just switch on whether it's equal to save or save-exit and perform the relevant function.






    share|improve this answer























    • The same question: how can I catch difference between those two buttons on server side?

      – Yurii N.
      Nov 22 '17 at 7:13











    • @YuriyN. Look at the value of the POSTed variable named action. If it's "save", the "Save" button was pressed. If it's "save-exit", the "Save and exit" button was pressed.

      – Bobby Jack
      Nov 23 '17 at 9:31











    • I'm not sure how can I do this at ASP.NET Core, could you explain please?

      – Yurii N.
      Nov 23 '17 at 9:35











    • I don't know asp.net, I'm afraid. Are you not already processing the 'bookInput' value? It should be the exact same procedure.

      – Bobby Jack
      Nov 23 '17 at 10:13











    • Yes, it is already processed, but this processing is already built-in ASP.NET Core, about processing button's value, I'm not sure.

      – Yurii N.
      Nov 23 '17 at 10:27













    1












    1








    1







    <form action="/Book/Crud" method="post">
    <input type="text" name="bookInput" />
    <button name="action" value="save" type="submit">Save</button>
    <button name="action" value="save-exit" type="submit">Save and exit</button>
    </form>


    Like other inputs, the button can have a name and value attribute which will be submitted to your backend on submit. Only the button that was clicked will send its value. You need to use whatever mechanism you're using to access the POSTed variable named action (in this example). Then just switch on whether it's equal to save or save-exit and perform the relevant function.






    share|improve this answer













    <form action="/Book/Crud" method="post">
    <input type="text" name="bookInput" />
    <button name="action" value="save" type="submit">Save</button>
    <button name="action" value="save-exit" type="submit">Save and exit</button>
    </form>


    Like other inputs, the button can have a name and value attribute which will be submitted to your backend on submit. Only the button that was clicked will send its value. You need to use whatever mechanism you're using to access the POSTed variable named action (in this example). Then just switch on whether it's equal to save or save-exit and perform the relevant function.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 22 '17 at 0:19









    Bobby JackBobby Jack

    11.9k95489




    11.9k95489












    • The same question: how can I catch difference between those two buttons on server side?

      – Yurii N.
      Nov 22 '17 at 7:13











    • @YuriyN. Look at the value of the POSTed variable named action. If it's "save", the "Save" button was pressed. If it's "save-exit", the "Save and exit" button was pressed.

      – Bobby Jack
      Nov 23 '17 at 9:31











    • I'm not sure how can I do this at ASP.NET Core, could you explain please?

      – Yurii N.
      Nov 23 '17 at 9:35











    • I don't know asp.net, I'm afraid. Are you not already processing the 'bookInput' value? It should be the exact same procedure.

      – Bobby Jack
      Nov 23 '17 at 10:13











    • Yes, it is already processed, but this processing is already built-in ASP.NET Core, about processing button's value, I'm not sure.

      – Yurii N.
      Nov 23 '17 at 10:27

















    • The same question: how can I catch difference between those two buttons on server side?

      – Yurii N.
      Nov 22 '17 at 7:13











    • @YuriyN. Look at the value of the POSTed variable named action. If it's "save", the "Save" button was pressed. If it's "save-exit", the "Save and exit" button was pressed.

      – Bobby Jack
      Nov 23 '17 at 9:31











    • I'm not sure how can I do this at ASP.NET Core, could you explain please?

      – Yurii N.
      Nov 23 '17 at 9:35











    • I don't know asp.net, I'm afraid. Are you not already processing the 'bookInput' value? It should be the exact same procedure.

      – Bobby Jack
      Nov 23 '17 at 10:13











    • Yes, it is already processed, but this processing is already built-in ASP.NET Core, about processing button's value, I'm not sure.

      – Yurii N.
      Nov 23 '17 at 10:27
















    The same question: how can I catch difference between those two buttons on server side?

    – Yurii N.
    Nov 22 '17 at 7:13





    The same question: how can I catch difference between those two buttons on server side?

    – Yurii N.
    Nov 22 '17 at 7:13













    @YuriyN. Look at the value of the POSTed variable named action. If it's "save", the "Save" button was pressed. If it's "save-exit", the "Save and exit" button was pressed.

    – Bobby Jack
    Nov 23 '17 at 9:31





    @YuriyN. Look at the value of the POSTed variable named action. If it's "save", the "Save" button was pressed. If it's "save-exit", the "Save and exit" button was pressed.

    – Bobby Jack
    Nov 23 '17 at 9:31













    I'm not sure how can I do this at ASP.NET Core, could you explain please?

    – Yurii N.
    Nov 23 '17 at 9:35





    I'm not sure how can I do this at ASP.NET Core, could you explain please?

    – Yurii N.
    Nov 23 '17 at 9:35













    I don't know asp.net, I'm afraid. Are you not already processing the 'bookInput' value? It should be the exact same procedure.

    – Bobby Jack
    Nov 23 '17 at 10:13





    I don't know asp.net, I'm afraid. Are you not already processing the 'bookInput' value? It should be the exact same procedure.

    – Bobby Jack
    Nov 23 '17 at 10:13













    Yes, it is already processed, but this processing is already built-in ASP.NET Core, about processing button's value, I'm not sure.

    – Yurii N.
    Nov 23 '17 at 10:27





    Yes, it is already processed, but this processing is already built-in ASP.NET Core, about processing button's value, I'm not sure.

    – Yurii N.
    Nov 23 '17 at 10:27











    1














    The answer of Bobby Jack is correct. I will elaborate on this answer in order to show how to access this input from within the controller. If you would use the following HTML:



    <form action="/Book/Crud" method="post">
    <input type="text" name="bookInput" />
    <button name="action" value="save" type="submit">Save</button>
    <button name="action" value="save-exit" type="submit">Save and exit</button>
    </form>


    You could reach the values: 'save' and 'save-exit' by defining another parameter in the controller like this:



    // The parameter 'action' is what will contain the values specified in the button.
    public IActionResult Crud(string bookInput, string action)

    // Implementation



    The name of the parameter needs to correspond to the value in the 'name' attribute of the form button (in this case 'action'). When the button is clicked, ASP.net will automatically assign the value of the 'value' attribute to the controller parameter. Or more specifically the controller parameter 'action' will have a value of 'save' or 'save-exit' retrieved from the attribute 'value'.






    share|improve this answer























    • Hello, thanks for the additional clarification!

      – Yurii N.
      Nov 12 '18 at 19:55















    1














    The answer of Bobby Jack is correct. I will elaborate on this answer in order to show how to access this input from within the controller. If you would use the following HTML:



    <form action="/Book/Crud" method="post">
    <input type="text" name="bookInput" />
    <button name="action" value="save" type="submit">Save</button>
    <button name="action" value="save-exit" type="submit">Save and exit</button>
    </form>


    You could reach the values: 'save' and 'save-exit' by defining another parameter in the controller like this:



    // The parameter 'action' is what will contain the values specified in the button.
    public IActionResult Crud(string bookInput, string action)

    // Implementation



    The name of the parameter needs to correspond to the value in the 'name' attribute of the form button (in this case 'action'). When the button is clicked, ASP.net will automatically assign the value of the 'value' attribute to the controller parameter. Or more specifically the controller parameter 'action' will have a value of 'save' or 'save-exit' retrieved from the attribute 'value'.






    share|improve this answer























    • Hello, thanks for the additional clarification!

      – Yurii N.
      Nov 12 '18 at 19:55













    1












    1








    1







    The answer of Bobby Jack is correct. I will elaborate on this answer in order to show how to access this input from within the controller. If you would use the following HTML:



    <form action="/Book/Crud" method="post">
    <input type="text" name="bookInput" />
    <button name="action" value="save" type="submit">Save</button>
    <button name="action" value="save-exit" type="submit">Save and exit</button>
    </form>


    You could reach the values: 'save' and 'save-exit' by defining another parameter in the controller like this:



    // The parameter 'action' is what will contain the values specified in the button.
    public IActionResult Crud(string bookInput, string action)

    // Implementation



    The name of the parameter needs to correspond to the value in the 'name' attribute of the form button (in this case 'action'). When the button is clicked, ASP.net will automatically assign the value of the 'value' attribute to the controller parameter. Or more specifically the controller parameter 'action' will have a value of 'save' or 'save-exit' retrieved from the attribute 'value'.






    share|improve this answer













    The answer of Bobby Jack is correct. I will elaborate on this answer in order to show how to access this input from within the controller. If you would use the following HTML:



    <form action="/Book/Crud" method="post">
    <input type="text" name="bookInput" />
    <button name="action" value="save" type="submit">Save</button>
    <button name="action" value="save-exit" type="submit">Save and exit</button>
    </form>


    You could reach the values: 'save' and 'save-exit' by defining another parameter in the controller like this:



    // The parameter 'action' is what will contain the values specified in the button.
    public IActionResult Crud(string bookInput, string action)

    // Implementation



    The name of the parameter needs to correspond to the value in the 'name' attribute of the form button (in this case 'action'). When the button is clicked, ASP.net will automatically assign the value of the 'value' attribute to the controller parameter. Or more specifically the controller parameter 'action' will have a value of 'save' or 'save-exit' retrieved from the attribute 'value'.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 12 '18 at 13:48









    FluousFluous

    242314




    242314












    • Hello, thanks for the additional clarification!

      – Yurii N.
      Nov 12 '18 at 19:55

















    • Hello, thanks for the additional clarification!

      – Yurii N.
      Nov 12 '18 at 19:55
















    Hello, thanks for the additional clarification!

    – Yurii N.
    Nov 12 '18 at 19:55





    Hello, thanks for the additional clarification!

    – Yurii N.
    Nov 12 '18 at 19:55











    0














    add different names



    <button type="submit" name="save">Save</button>
    <button type="submit" name="saveExit">Save and exit</button>





    share|improve this answer


















    • 2





      And how can I catch difference between this buttons?

      – Yurii N.
      Jun 22 '16 at 16:28















    0














    add different names



    <button type="submit" name="save">Save</button>
    <button type="submit" name="saveExit">Save and exit</button>





    share|improve this answer


















    • 2





      And how can I catch difference between this buttons?

      – Yurii N.
      Jun 22 '16 at 16:28













    0












    0








    0







    add different names



    <button type="submit" name="save">Save</button>
    <button type="submit" name="saveExit">Save and exit</button>





    share|improve this answer













    add different names



    <button type="submit" name="save">Save</button>
    <button type="submit" name="saveExit">Save and exit</button>






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jun 22 '16 at 16:21









    KintamasisKintamasis

    129216




    129216







    • 2





      And how can I catch difference between this buttons?

      – Yurii N.
      Jun 22 '16 at 16:28












    • 2





      And how can I catch difference between this buttons?

      – Yurii N.
      Jun 22 '16 at 16:28







    2




    2





    And how can I catch difference between this buttons?

    – Yurii N.
    Jun 22 '16 at 16:28





    And how can I catch difference between this buttons?

    – Yurii N.
    Jun 22 '16 at 16:28











    0














    Example from VB.net:



    <asp:Button id="cmdKeyphraseAdd" runat="server" Text="Add Keyphrase" onclick="cmdKeyphraseAdd_Click"></asp:Button>





    share|improve this answer



























      0














      Example from VB.net:



      <asp:Button id="cmdKeyphraseAdd" runat="server" Text="Add Keyphrase" onclick="cmdKeyphraseAdd_Click"></asp:Button>





      share|improve this answer

























        0












        0








        0







        Example from VB.net:



        <asp:Button id="cmdKeyphraseAdd" runat="server" Text="Add Keyphrase" onclick="cmdKeyphraseAdd_Click"></asp:Button>





        share|improve this answer













        Example from VB.net:



        <asp:Button id="cmdKeyphraseAdd" runat="server" Text="Add Keyphrase" onclick="cmdKeyphraseAdd_Click"></asp:Button>






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 22 '16 at 16:32









        AtrixAtrix

        1735




        1735



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f37973455%2fpass-additional-data-with-submit-button%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

            Darth Vader #20

            Ondo