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
Debopriyo Dey
NA
51
15.9k
bind checkbos from database using jquery.
Sep 14 2017 1:58 AM
I have a checkboxlist as follows
<div class="form-group" id="chkbxSpeciality">
<p class="help-block" id="lblSpecialityErr" style="color: Red;">
</p>
</div>
and this is the js to bind data from database.
function BindSpecialityType() {
$.ajax({
type: "POST",
url: "MRRegistration.aspx/GetSpeciality",
data: {},
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
var objdata = $.parseJSON(response.d);
BindSpecialityCheckBoxList('chkbxSpeciality', objdata);
}
});
}
function BindSpecialityCheckBoxList(target, data) {
var table = $('<table></table>');
var counter = 0;
$(data).each(function () {
table.append($('<tr></tr>').append($('<td></td>').append($('<input>').attr({
type: 'checkbox', name: 'chklistitem', value: this.SPECIALITYID , id: target + counter
})).append(
$('<label>').attr({
for: 'chklistitem' + counter++
}).text(this.SPECIALITYNAME ))));
});
}
but i am not able to bind. Please help
Reply
Answers (
2
)
User Controls in Asp.net
How Export data into excel in mvc4 directly ?