# Perform different functions when submitting a form, validating fields, depending on which action button is clicked

**URL:** <https://forum.radzen.com/t/perform-different-functions-when-submitting-a-form-validating-fields-depending-on-which-action-button-is-clicked/15758>\
**Category:** Radzen.Blazor Components\
**Created:** [November 21, 2023, 6:07pm UTC](https://forum.radzen.com/t/perform-different-functions-when-submitting-a-form-validating-fields-depending-on-which-action-button-is-clicked/15758 "2023-11-21T18:07:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zehguilherme](https://forum.radzen.com/user_avatar/forum.radzen.com/zehguilherme/32/14952_2.png) [@zehguilherme](https://forum.radzen.com/u/zehguilherme)\
**Post date:** [November 21, 2023, 6:07pm UTC](https://forum.radzen.com/t/perform-different-functions-when-submitting-a-form-validating-fields-depending-on-which-action-button-is-clicked/15758/1 "2023-11-21T18:07:13Z")

</div>

In the same form that contains more than 1 action button, I want to validate the fields on all buttons. In other words, each of the buttons is of type `submit` and each of them must trigger a different function when submitting the form.

 ![image](https://forum.radzen.com/uploads/default/original/3X/b/5/b54d57e6ad1b9fa219172b7511019d16f388dcbf.png)

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [November 21, 2023, 6:10pm UTC](https://forum.radzen.com/t/perform-different-functions-when-submitting-a-form-validating-fields-depending-on-which-action-button-is-clicked/15758/2 "2023-11-21T18:10:46Z")

</div>

You can set different flags depending on which button is pressed and check these flags in the form Submit event.

---

<div class="post-metadata">

**Author:** ![zehguilherme](https://forum.radzen.com/user_avatar/forum.radzen.com/zehguilherme/32/14952_2.png) [@zehguilherme](https://forum.radzen.com/u/zehguilherme)\
**Post date:** [November 21, 2023, 6:28pm UTC](https://forum.radzen.com/t/perform-different-functions-when-submitting-a-form-validating-fields-depending-on-which-action-button-is-clicked/15758/3 "2023-11-21T18:28:05Z")

</div>

How can I check if a certain button has been pressed?

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [November 21, 2023, 7:22pm UTC](https://forum.radzen.com/t/perform-different-functions-when-submitting-a-form-validating-fields-depending-on-which-action-button-is-clicked/15758/4 "2023-11-21T19:22:25Z")

</div>

In the button Click event.

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [November 21, 2023, 8:14pm UTC](https://forum.radzen.com/t/perform-different-functions-when-submitting-a-form-validating-fields-depending-on-which-action-button-is-clicked/15758/5 "2023-11-21T20:14:33Z")

</div>

Yeah, set a boolean (or other) field in the click event of the buttons. Then check if that field is set or not in the Submit event of the form.
