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?


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.

  • 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>

    <abp-button type="submit" iconClass="fa fa-check" (click)="submitForm()" [disabled]="form?.invalid">
      {{ 'AbpUi::Save' | abpLocalization }}
    </abp-button>
    

    </ng-template>

  • 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()">

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 v9.3.0-preview. Updated on June 12, 2025, 09:12