Form Submit and Validate with Button outside of RadzenTemplateForm

Hello,

I have a button outside the RadzenTemplateForm - how to Submit the form that also the Validate (RadzenRequiredValidator) works?

        <RadzenButton ButtonStyle="ButtonStyle.Primary" ButtonType="Radzen.ButtonType.Submit" Click="@FormSubmit" Icon="save" Text="Speichern" Style="margin-right: 0.5rem" Variant="Variant.Flat" />

or is it nesessary to place the "Submit" Button inside the RadzenTemplateForm?

regards

Hi @Mad.Rain,

There is a relatively unknown HTML attribute called form which allows buttons to submit a form they are not nested in. Try something like this:

<RadzenTemplateForm id="myForm" ...>
</RadzenTemplateForm>
<RadzenButton form="myForm"  ... />
4 Likes