How to prevent model close when Enter key press in TelerikForm

0 Answers 28 Views
Form
Rajkumar
Top achievements
Rank 1
Rajkumar asked on 08 Jan 2025, 08:46 AM
 <TelerikForm EditContext="EditContext" OnValidSubmit="Save" Columns="3" ColumnSpacing="15px">
     <FormValidation>
         <FluentValidationValidator />
     </FormValidation>
     <FormItems>
         <FormItem Id="fiInvoiceFooterElemenName" ColSpan="2">
             <Template>
                 <label class="k-label k-form-label" for="ddlInvoiceFooterElement">@Resources.InvoiceFooterElementName</label>
                 <TelerikDropDownList Id="ddlInvoiceFooterElementName"
                                      TItem="@InvoiceFooterElementCategory"
                                      TValue="@Guid"
                                      TextField="@nameof(InvoiceFooterElementCategory.FullName)"
                                      ValueField="@nameof(InvoiceFooterElementCategory.InvoiceFooterElementCategoryId)"
                                      Data="@invoiceFooterElementCategories"
                                      @bind-Value="@invoiceFooterElementLine.InvoiceFooterElementCategoryId"
                                      OnChange="OnChangeInvoiceFooterElementCategories"
                                    
                                      Width="100%"
                                      DefaultText="@Resources.SelectInvoiceFooterElementCategory">
                     <DropDownListSettings>
                         <DropDownListPopupSettings Height="auto" MaxHeight="250px" Width="auto" />
                     </DropDownListSettings>
                     @* <ItemTemplate>
                         <span>@($"{context.Name} ({context.Code})")</span>
                     </ItemTemplate> *@
                 </TelerikDropDownList>
                 <ValidationMessage For="@(() => invoiceFooterElementLine.InvoiceFooterElementCategoryId)" />
             </Template>
         </FormItem>
     </FormItems>
     <FormButtons>
         <button id="btnSave" type="submit" class="btn btn-sm btnAction btn-action-filled-blue mr-1 mt10">
             @if (saving)
             {
                 <span class="spinner-border spinner-border-sm mr-1"></span>
             }
             @Resources.OK
         </button>
         <button id="btnCancel" type="button" class="btn btn-sm btnAction btn-action-stroke-black mt10" @onclick="@Cancel">
             @Resources.Cancel
         </button>
     </FormButtons>
 </TelerikForm>



i am trying to prevent model close when i changes some text after that press enter key then Model close automatically

No answers yet. Maybe you can help?

Tags
Form
Asked by
Rajkumar
Top achievements
Rank 1
Share this question
or