I have a question which I am sure is simple but I have slight problem getting it to work. I have wrote a function in an external js file which has one parameter.
In my HTML I have onclick event where the arguement I want to supply is the value in a dropdown menu, hence me using document.getElementById to grab that value. But when I trigger the event it is complaining.
<select id="ddlOriginHubChinaSea" onclick="chkHub(document.getElementById('ddlOriginHubChinaSea').val())" >
<option value="Cambodia">Cambodia</option>
<option value="HK">HK</option>
<option value="Indonesia">Indonesia></option>
<option value="Shanghai">Shanghai</option>
<option value="Thailand">Thailand</option>
</select>
function chkHub(param) {
if (param != '') {
$('#txtChinaSeaAirHub').val(param);
}
else {
$('#txtChinaSeaAirHub').val('');
}
}
Try this out: