0
With this select
<label>Quantos módulos fiscais a sua propriedada tem:</label>
<select id="fiscalModule">
<option value="minifundio">até 1 módulo fiscal</option>
<option value="small_propertie">maior que 1 e até 2 módulos fiscais</option>
<option value="medium_propertie">maior que 2 a até 4 módulos fiscais</option>
<option value="secondCategorie_medium_propertie">maior que 4 a até 10 módulos fiscais</option>
<option value="bigPropertie">maior que 10 módulos fiscais</option>
</select>
I can return if the value of the first option
[value = "foundry"]
was selected:
let fiscalModule = document.querySelector('select[id=fiscalModule]');
let isMinifundio = fiscalModule.options[fiscalModule.selectedIndex].value == 'minifundio' ? true : false;
However I can not return the other options, as
[value = "bigPropertie"]
Here’s my link to jsfiddle
I don’t know, but it seems that when you choose the state, the list of cities should change. And it doesn’t. So, the problem should be bigger. Personally, I find it very complicated to use jQuery for this... Great classic of libraries: it seems nice, easy, but when you start having trouble.... Put an Alert in Ubmit to see the content you receive from select.
– Peter
Our girl, 1° that code posted has nothing to do with jQuery, 2nd of course can only return the first option, because in this part of the code
== 'minifundio' ? true : false;
does the check with the first option only, as could return the other?!!– LeAndrade
dear, of course you have more check options. thank you
– Lilian Guimarães