This text is placed in the header section
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
Now this content is within the body of the document
<select name="product" id="product">
<option value="1">Choose Your Product</option>
<option value="2">On Grid Power Solution</option>
<option value="3">Off Grid Energy System</option>
<option value="4">Solar Water Pump [Irrigation]</option>
<option value="5">Solar Water Heater Installation</option>
<option value="6">Online UPS Setup</option>
<option value="7">Residential UPS Backup Solutions</option>
<option value="8">Inverter for Generator Replacement </option>
<option value="9">Energy Efficient LED Lighting Products</option>
<option value="10">Powerplant Leasing with ESCOMs</option>
<option value="11">Installation of Online UPS Units</option>
</select>
<input type="file" name="file_attach[]" />
The following script is located outside the body tags
<script type="text/javascript">
$(document).ready(function() {
$("#product").change(function() {
if ($("#product option[value='2']").attr('selected')) {
$('.file_attach').css('display','block');
}
else{
$('.file_attach').css('display','none');
}
});
});
</script>
Whenever a selection is made, it triggers an action to hide the file attachment input.