Completed
Last Updated: 30 Mar 2022 11:55 by ADMIN
Release 3.2.0
Christian
Created on: 05 Jun 2020 06:36
Category: Button
Type: Feature Request
15
Form parameter for the button
I have a EditForm and want to place the submit / reset Buttons outside the EditForm Tag.

In HTML 5 there is a 'form' Attribute on a button Tag, but the Telerik button doesn't seem to have that. I tried using the @attributes parameter, but this didn't work.

So, how can I achieve this?
5 comments
Chris
Posted on: 25 Mar 2022 21:25
Just hit this in my Telerik Trial as well. In our minimal UI design, we have action toolbar that does various actions in the app. This toolbar sits outside the TelerikForm so we need a way to submit the form with an "external" button. I would imagine this wouldn't be a heavy lift, but I'll leave that to you guys to determine LOL.
ADMIN
Marin Bratanov
Posted on: 20 Sep 2021 16:00

Hello,

The best way to know when a new feature gets implemented is to click the Follow button. This will send you a notification email when there is movement on the page. We do keep the porta up to date, and our management reviews the popularity of the various items in it when prioritizing items for each release.

 

Regards,
Marin Bratanov
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/.

jura
Posted on: 20 Sep 2021 08:00

I this simple attribute going to be implemented any soon?

Thank You.

Marek Istvanek

jura
Posted on: 01 Feb 2021 09:33

I need it as well.

For now I have implemented it in our derived button class by overriding RenderTree together with FocusAsync support.

ADMIN
Marin Bratanov
Posted on: 05 Jun 2020 06:38

Hi,

A workaround for the time being could be using a standard button and the Telerik classes to style it:

@using System.ComponentModel.DataAnnotations

<button type="submit" form="myForm" class="k-button k-primary">submit the form from outside</button>

<EditForm id="myForm" Model="@person" OnValidSubmit="@HandleValidSubmit">
    <DataAnnotationsValidator />
    <ValidationSummary />

    <p class="name">
        <label for="nameTextbox">Name:</label>
        <TelerikTextBox @bind-Value="@person.Name" Id="nameTextbox"></TelerikTextBox>
        <ValidationMessage For="@(() => person.Name)"></ValidationMessage>
    </p>

    <p class="height">
        <label for="heightNumeric">Height (cm):</label>
        <TelerikNumericTextBox @bind-Value="@person.Height" Id="heightNumeric" />
        <ValidationMessage For="@(() => person.Height)"></ValidationMessage>
    </p>

</EditForm>

@code {
    // Usually this class would be in a different file
    public class Person
    {
        [Required(ErrorMessage = "Enter a name")]
        [StringLength(10, ErrorMessage = "That name is too long")]
        public string Name { get; set; }

        [Required(ErrorMessage = "Provide your height in centimeters")]
        [Range(1, 300, ErrorMessage = "Nobody is that tall")]
        public int? Height { get; set; }
    }

    Person person { get; set; } = new Person();

    void HandleValidSubmit()
    {
        Console.WriteLine("OnValidSubmit");
    }
}

 

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.