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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:21:38+00:00 2026-05-17T22:21:38+00:00

I have two submit buttons in one form. I want to call different actions

  • 0

I have two submit buttons in one form. I want to call different actions in both buttons. Is there any way to accomplish this without using JavaScript.

  • 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-17T22:21:39+00:00Added an answer on May 17, 2026 at 10:21 pm

    Calling different actions is not possible without javascript. You could call the same controller action and inside this action determine which button was pressed using the name property:

    <% using (Html.BeginForm()) { %>
        <input type="submit" name="save" value="Save" />
        <input type="submit" name="update" value="Update" />
    <% } %>
    

    and in your controller action:

    [HttpPost]
    public ActionResult Index(string save)
    {
        if (!string.IsNullOrEmpty(save))
        {
            // the save button was pressed
        }
        else
        {
            // the update button was pressed
        }
        return View();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form like this: one.php <form id='myFormId' name='myFormName'> <input type='text' name='myTextField'> <a
I have JSF page has two drop down lists and I want to load
My scenario is this: I have two listbox's, one that contains all my database
I have two views: create and edit. Both share a strongly typed editor template
Hey I am very new to Web Programming. I have been learning PHP from
I have an embedded application running httpd for a web server. On the main
this is a general form code <form name=search_form action= method=POST> <input type=text name=search_text> <input
I've one problem with editing a row... I wanted to use a button to
I'm sorry if this is a very simplistic question but I'm still learning the
Hello Everybody now i working with JSF 2.0 and EJB3 and i used Primefaces

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.