opdahlmann / ng2-opd-popup-sample

4 stars 13 forks source link

When clicking on Cancel or Submit Button, It submits the whole form instead of just completing the popup. #4

Open ghyoju opened 7 years ago

ghyoju commented 7 years ago

Hi Ole,

Will you please add $event.preventDefault() to the click events for cancel and confirm buttons so that it does not submit the whole form? <button id="cancelBtn" [ngClass]="cancelBtnStyle" type="reset" (click)="confirmNo(); $event.preventDefault()">{{popupService.options.cancleBtnContent}}</button> <button id="confirmBtn" [ngClass]="confirmBtnStyle" (click)="confirmYes(); $event.preventDefault()" >{{popupService.options.confirmBtnContent}}</button>

or provide option to submit whole form or popup.

I can update the code if that is ok.

Thanks, Gyan