0
I tried several ways but was unsuccessful in creating a window.Alert(); with Return false; if no select field of name="producto_qtd[]" is selected or if it does not exist, but unsuccessfully, I looked around and no response adapted to what I need.
Example:
<select name="produto_qtd[]" class="form-control">
<option value="">Produto X - Selecione quantidade</option>
<option value="10">10 itens</option>
<option value="20">20 itens</option>
<option value="50">50 itens</option>
</select>
<select name="produto_qtd[]" class="form-control">
<option value="">Produto Y - Selecione quantidade</option>
<option value="10">10 itens</option>
<option value="20">20 itens</option>
<option value="50">50 itens</option>
</select>
Or if select does not exist, also check and return a window.Alert(); and Return false; stating "No quantity selected", only.
There is a case that the select related to the product is lost due to the declared value of the product being higher than the contracted plan, and other cases the select exists but no "value" with value has been selected.
But is it a multiple select or multiple selects with the same name? What exactly are you trying to do?
– Leandro Angelo
It is more of a select, as it was necessary so that the file requested by . ajax() treats select as an array due to a peculiar project need.
– ElvisP
Managed to solve?
– Leandro Angelo