I have a% co_of% of 27 options and a% co_of%:
Depending on the selected option of select
I have to send a different data in input
as well as have to enter a function.
<div class="select" *ngIf="bandcatalogonis" >
<select name="seleccion" id="op" (change)="Opciones($event.target.value)">
<option value="1" id="opts">ID</option>
<option value="2" id="opts">Nis</option>
</select>
<input type="submit" value="Buscar" id="buc" (click)="buscar()">
Create a function where valid which option was selected:
Opciones(opc) {
//console.log(opc);
if(opc == '1'){
console.log("ID 1");
}else if(opc == '2'){
console.log("ID 2");
}else if(opc == '3'){
console.log("Perimetro");
}else if(opc == '4'){
console.log("X");
}
The problem is that when you sent the data only enters a function, I could not make it through the selected option sent a different data and enter different functions:
buscar() {
if (this.dos === null) {
this.bandnisnull = true;
setTimeout(() => {
this.bandnisnull = false;
}, 2100);
} else {
this.buscarClaveCat();
this.bandtabla1 = false;
this.bandtablaclavecat2 = true;
}
}
Any suggestions please.