1
I have a "dilemma" when registering a product, because not all clothing options are for any gender, for example the option Saia
and Vestido
cannot be of the genre M (Masculino)
, for gender only F (Feminino)
.
What I wish was done:
- When choosing the option
Saia
orVestido
in the fieldRoupa
, the fieldGênero
below was automatically filled in for the<option>
F
. - When an item is an
Camiseta
,Calça
,Bermuda
or aJaqueta
(can be as much toM
andF
), the<option>
always remain the first option of<select>
(null).
How this kind of behavior should be done?
<!DOCTYPE html>
<html>
<head>
<title> Cadastrar produto </title>
</head>
<body>
<form>
<p> Roupa:
<select name="nome" id="nome" required="">
<option value=""></option>
<option value="Camiseta">Camiseta</option>
<option value="Calça">Calça</option>
<option value="Bermuda">Bermuda</option>
<option value="Jaqueta">Jaqueta</option>
<option value="Saia">Saia</option>
<option value="Vestido">Vestido</option>
</select>
</p>
<p> Gênero:
<select name="genero" id="genero" required="">
<option value=""> </option>
<option value="M">M</option>
<option value="F">F</option>
</select>
</p>
<p> <input type="submit" name="Inserir" value="Cadastrar produto"> </p>
</form>
</body>
</html>
make a function linked to the "change" event of the select "name", and based on the arrow value correctly the gender value
– Ricardo Pontual
You may have a man-only item?
– Sam
I don’t think you need it, just for women.
– user191558