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>

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

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

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38