Issue with (this).val and select box (combo)
I've been over my head this last few days triying to create a combo select (the option "chile" makes the next select display).
Im using this script to handle the request.
- $(document).ready(function(){$("#selectionpais").change(function(){
- if ($(this).attr("value") != "chile"){$("#ciudad").hide();}
- else {$("#ciudad").show()} ;
- });
- });
And this is the select option;
- <select name="pais" id="selectionpais">
- <option value="..." selected="selected">....</option>
- <option value="chile" >Chile</option>
- <option value="af">Afganistán</option>
- </select>
And this is the select that should be shown after the user has selected the option chile.
- <select id="ciudad" name="ciudad" class="ciudad">
- <option>Santiago</option>
- </select>
The page is hosted here (if you find any errors or plain stupidity in the making please let me know);
htto://meds.chorrillana.cl/Index.html
Any help would be deeply appreciated 'cause I just cant seem to get it working.