When I choose from the dropdown list, I want to get the selected value of the dropdown list and show in the . But I try to do with above code, it didn't work ? whats wrong on that, plz suggest me. Thanks
$('.assetgroupSelect').on('change', function () {
var value = $('.assetgroupSelect').val();
if (value != "") {
$('#idValue').text(value)
}
}).trigger('change');
<?
$select_query = "Select Group_ID, Group_Name from Asset_Group";
global $DB;
$arrResult = array();
$err_mess = 'Test';
$result = $DB->Query($select_query, false, $err_mess.__LINE__);
?>
<tr height="50">
<td style="width: 220px">
<label for="assetGroup">
<span style="color:red">*</span>Asset Group:
</label>
</td>
<td>
<select id="assetgroupSelect" name ='assetgroupSelect'>
<option value="">(choose asset group)</option>
<? while ($arrResult = $result->Fetch()) { ?>
<option value="<? echo $arrResult['Group_ID'] ?>"> <? echo $arrResult['Group_Name'] ?> </option>
<? } ?>
</select><br><br>
<div class="placer">
Current index is :
<div id="idValue"></div>
</div>
</td>
</tr>