Rookie here, I need to make a select where, on the button area on click, the selected value is called to a function. Said function works good but it calls error when retrieving the selected value.
<form method="post">
Usuario: <select name="user" id="user">
<option value="" disabled selected>Seleccione un usuario</option>
<option [value]=usuario.id *ngFor="let usuario of usuarios">{{usuario.name}}</option>
</select>
<button type="submit" (click)=showALLuserposts(this)>OK!</button>
</form>
I tried changing the value on showALLuserposts(it needs to receive a string) and can confirm the function works because if button is inside the for cycle it receives the value and works as intended but ends up being like 8 buttons