Remove Clear Button on Asp.Net Core Form

1 Answer 1058 Views
Button Form
Xavier
Top achievements
Rank 1
Xavier asked on 01 Jun 2021, 10:40 AM

Hi eveyone,

How can i remove the Form Clear Button?

Thanks

Emerson
Top achievements
Rank 1
commented on 21 Feb 2022, 08:17 PM

Hello, I also need to add the clean button with this code to change the text of the button.
Alexander
Telerik team
commented on 24 Feb 2022, 03:39 PM

Hi Emerson,

You can use the .ButtonsTemplateId() configuration option and provide a template for both the submit and clear buttons. For example:

.ButtonsTemplateId("buttons")

<script id="buttons" type="text/x-kendo-template">
    <div class="myButtonsContainer">
		<div class="myButtonsContainer">
			<button class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-form-submit">
				<span class="k-button-text">My Submit Button</span>
			</button>
			<button class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-form-clear">
				<span class="k-button-text">My Clear Button</span>
			</button>
		</div>
    </div>
</script>

In addition, as of version R1 2022, the Button introduces new rendering and styling options that you can use in order to customize the look and feel of a given Button, as per your preference. More information you can find here:

Button Appearance

With that said, here is a Telerik REPL that illustrates the mentioned above.

1 Answer, 1 is accepted

Sort by
1
Accepted
Petar
Telerik team
answered on 02 Jun 2021, 10:41 AM

Hi Hi Xavier.,

You can use the following Form component configuration:

.ButtonsTemplate("<button class=\"k-button k-primary k-form-submit\" type=\"submit\">Submit</button>")

With the definition of the above ButtonsTemplate, we will add only the Submit button to the Form.

I hope the above suggestion will help you implement what you need in your application. 

Regards,
Petar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

M
Top achievements
Rank 1
commented on 08 Dec 2022, 11:54 PM

Hi,

How it can be done by Tag helpers?

Thanks

Alexander
Telerik team
commented on 12 Dec 2022, 04:51 PM

Hi,

The Telerik UI for ASP.NET Core Form TagHelper exposes both a "buttons-template" and "buttons-template-id" TagHelper attributes that can be utilized for altering the buttons' markup as per your requirements. Here is an example:

<kendo-form name="exampleForm" buttons-template="<button class='k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-form-submit' type='submit'>My Submit</button>">

For your convenience, here is Telerik REPL that tackles the aforementioned configuration:

And another Telerik REPL example that showcases the utilization of the "buttons-template-id" configurations as well similarly to how it is illustrated in my previous reply in the thread:

Tags
Button Form
Asked by
Xavier
Top achievements
Rank 1
Answers by
Petar
Telerik team
Share this question
or