I'm trying to call the JavaScript function on automatically selected value from dropdown options on the basis of what value came from DB. Right now JavaScript function got called when I change options from the front-end. Here is my code. What I want is to call JavaScript Getstate(this.value) function on automatically selection which depends on the value came from DB. Any suggestions?
<label>Province: </label><br>
<select name="Provincedown" id="ProvinceDropDown" class="form-control" onChange="getState(this.value);">
<option value="SelectProvince" <?=$ProvinceName == 'SelectProvince' ? ' selected="selected"' : '';?> > Please Select </option>
<option value="Sindh" <?=$ProvinceName == 'Sindh' ? ' selected="selected"' : '';?>> Sindh </option>
</select>
getState(this.value) is my JavaScript function in which I'm using AJAX and making my data JSON and sending to another page.