Loading default value in a dropdown and calling onchange event
- by J. Davidson
Hi i have following dropdown
<div class="fcolumn">
<label class="text" for="o_Id">Months:</label>
<select class="textMonths" id="o_Id" name="periodName" >
<option value="000">Select Period--</option>
</select>
</div>
In the following jquery, first it loads fnLoadP() in a drop down list. Than as a default I am loading one of the values in drop down which is '10'. It loads too as default value. But it should be executing $("#o_Id").change.. which it doesn't.
$(document).ready(function () {
var sProfileUserId = null;
$("#o_Id").change(function () {
//----
});
fnLoadP();
$("select[name='pName']").val('10');
});
});
Basically my goal is. After dropdown values are loaded, to load '10' as default value and call onchange event in the dom. Please let me know how to fix it.