-1
ドロップダウンリストでデータベースを分類するにはどうすればいいですかカテゴリのサブカテゴリを知る方法ドロップダウン選択?
私はINVORGカテゴリをクリックしてDEPTCODEで表示しますか?
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
//Dropdownlist Selectedchange event
$("#INVORG").change(function() {
$("#DEPTCODE").empty();
$.ajax({
type: 'POST',
url: '@Url.Action("GetDEPTCODE")', // we are calling json method
dataType: 'json',
data: { id: $("#INVORG").val() },
// here we are get value of selected INVORG and passing same value
success: function (states) {
// states contains the JSON formatted list
// of states passed from the controller
$.each(states, function (i, state) {
$("#DEPTCODE").append('<option value="' + state.Value + '">' +
state.Text + '</option>');
// here we are adding option for States
});
},
error: function (ex) {
alert('Failed to retrieve states.' + ex);
}
});
return false;
})
});
</script>
こんにちは先生 –
は、この[リンク]を参照してください表示されませんinvorgの下で動作しませんでしたあなたのコード、(https://dotnetfiddle.net/1bPZym) – Learner
この回答はあなたの元の質問に投稿されました。あなたは全体の質問を変更できますか? @ThePrograMMER – Learner