BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
<form [formgroup]="radioForm" novalidate id="formId" (ngsubmit)="onSubmit()">
<div class="row">
<ejs-radiobutton formcontrolname="payment" label="Cash on Delivery" name="payment" value="cashondelivery"></ejs-radiobutton>
</div>
<div class="row">
<ejs-radiobutton formcontrolname="payment" label="Other Wallets" name="payment" value="others"></ejs-radiobutton>
</div>
<div *ngif="payment.invalid" class="alert alert-danger">
Select Any payment mode
</div>
<button id="submit" type="submit" [disabled]="!radioForm.valid">Submit</button>
</form> |
//…
import { FormValidators } from '@syncfusion/ej2-angular-inputs';
//…
export class AppComponent implements OnInit {
radioForm: FormGroup;
@ViewChild('formElement') element: any;
constructor() {
this.radioForm = new FormGroup({
'payment': new FormControl('', [FormValidators.required])
});
}
ngOnInit(): void {}
get payment() { return this.radioForm.get('payment'); }
onSubmit() {
let submit: HTMLButtonElement = <HTMLButtonElement>document.getElementById('submit');
if (!submit.disabled)
alert("Success")
}
} |