Open Closed

Hitting enter triggers form submit #1957


User avatar
0
Rrader30 created
  • ABP Framework version: v4.4.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hello. I am currently using devexpress tagbox to have input tags. My issue is when you add a tag you have to hit the enter button and the tag adds but the ABP submit button also triggers. How can I setup the submit button so it does not trigger on hitting enter button?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

3 Answer(s)
  • User Avatar
    0
    bunyamin created

    Hello,

    This directive is responsible for submitting the form when hitting enter. You can simply delete (ngSubmit)="save()" from your template and it will stop triggering.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Rrader30 created

    bunyamin, So I currently do not have (ngSubmit). Here is my submit button

    <ng-template #abpFooter> <button type="button" class="btn btn-secondary" abpClose> {{ 'AbpUi::Cancel' | abpLocalization }} </button>

    &lt;abp-button type=&quot;submit&quot; iconClass=&quot;fa fa-check&quot; (click)=&quot;submitForm()&quot; [disabled]=&quot;form?.invalid&quot;&gt;
      {{ 'AbpUi::Save' | abpLocalization }}
    &lt;/abp-button&gt;
    

    </ng-template>

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    bunyamin created

    No, you should have it on your form element. Take a look at the selector: form[ngSubmit][formGroup]

    So, it should look like the following:

    <form [formGroup]="form" (ngSubmit)="save()">

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.