My AJAX function generates #parent select-box on the fly. The problem is, i can’t set exact option after menu generation
Tried
window.onload = function () {
var parent='1';
$('#parent').val(parent);
}
And
$(document).ready(function () {
var parent='1';
$('#parent').val(parent);
});
no success!. Any suggetions?
Neither
onloadnorreadywill wait for an Ajax request. Move the function to the callback that you pass to the success handler.