I have the following drop down:
<select name="chooseLanguage">
<option>Choose One</option>
<option value="java">Java</option>
<option value="php">PHP</option>
<option value="c++">C++</option>
</select>
If ANYTHING is selected from this dropdown other than the default "Choose One" which is of course preselected, then I want this input field to disappear:
<input type="file" name="uploadFile" />
How can this be achived using jQuery (if possible with a nice fade effect)?
EDIT
My entire code, for some reason none of the answers have worked for me.
<script type="text/javascript" src="jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(function(){
$("#chooseLanguage").change(function(){
if ($(this).val() == '') {
$("#uploadFile").hide();
} else {
$("#uploadFile").show();
}
});
});
</script>
<form action="" method="post">
<select name="chooseLanguage" id="chooseLanguage">
<option>Choose One</option>
<option value="java">Java</option>
<option value="php">PHP</option>
<option value="c++">C++</option>
</select>
<input type="file" name="uploadFile" id="uploadFile" />
</form>