TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Marius Vasile
552
1.9k
145.8k
asp.net core combine select, javascript and bootstrap-select
Jan 25 2021 2:26 PM
I have a cascade select
<select id=
"Location"
class
=
"form-control border-warning selectpicker"
asp-items=
"Model.Locations"
OnChange=
"func1()"
>
<option value=
""
>--Select Asset Location--</option>
</select>
<select id=
"Asset"
class
=
"form-control border-warning selectpicker"
asp-items=
"@(new SelectList(string.Empty, "
WOAId
", "
AssetID
", "
AssetName
"))"
OnChange=
"func2()"
>
<option value=
""
>--Select Asset--</option>
</select>
and getting the value for the second select with
$(
"#Location"
).on(
"change"
, function () {
var categoryId = $(
this
).val();
$(
"#Asset"
).empty();
$(
"#Asset"
).append(
"<option value=''>--Select Asset--</option>"
);
$.getJSON(`?handler=Asset&id=${categoryId}`, (data) => {
$.each(data, function (i, item) {
$(
"#Asset"
).append(`<option value=
"${item.value}"
> ${item.text}</option>`);
});
});
});
How do I include bootstrap-select into the above?
$(
'#Location'
).selectpicker({
liveSearch:
true
});
$(
'#Asset'
).selectpicker({
liveSearch:
true
});
Reply
Answers (
8
)
.net core i want o use lamda function and connect the AuroraDB
json schema validation