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
Mahesh Bodepudi
NA
90
56.5k
Disable dropdown controls in MVC4 using JQuery
Aug 22 2016 6:32 AM
Hi,
I have a such scenario where I have to disable some of the controls including the dropdown based on a criteria.
If one of radio button radio is checked and when clicking on submit button the controls should be disabled.Its working for a maximum extent.But some times the page is getting refreshed when clicking on submit button and the controls are appearing and disappearing the page refresh.The page refresh happens only sometimes.
Here is the code for submit button click.
$(#SearchBtn').click(function () {
$('#DivSlNo').hide();
var chkVal = $('input[name=SearchBy]:checked').val();
if (chkVal == 'ShowAll') {
$('#DivSlNo').hide();
$('#DivCriteria').hide();
$('#DivECSId').hide();
}
});
Please help how to overcome this issue?
Tried in the following way to disable the individual elements and div elements.
$('#DivECSId').attr('disabled', 'disabled');
$('#DivECSId').hide();
$('#tdSearchFields :input').attr('disabled', true);
$("#tdSearchFields").find("input,button,textarea,select").attr("disabled", true);
But nothing works for me.
Reply
Answers (
2
)
Date is not binding correctly while generating report in MVC
MVC4 Data is not save in DB because view are bind in model