This question is locked. New answers and comments are not allowed.
So I'm having a similar problem as described here:
http://www.telerik.com/community/forums/aspnet-mvc/datepicker/adding-a-css-class-through-inputhtmlattributes.aspx
In short, I need to ignore jquery validation based off certain criteria. So I attempted to use:
.InputHtmlAttributes(new { @class = "ignore1" })
In conjunction with:
<script type="text/javascript">
// Ignore those fields we don't want to validate
$(function () {
var settngs = $.data($('#PersonalTab')[0], 'validator').settings;
settngs.ignore = ".ignore1";
});
</script>
This however throws a Jquery error @ var B=A.length; Saying Length is undefined when clicking on the ComboBox, you can tell something is off by the look of the ComboBox as well.
One thing to note, is it works through JQuery:
$(document).ready(function () {
if (!$('#ddl').hasClass('ignore1')) {
$("#ddl").addClass("ignore1");
}
});
I'd like to avoid the use of unnecessary javascript function downloads. Can anyone help on this?
Thanks!
EDIT/Fix - Change InputHtmlAttributes to HiddenInputHtmlAttributes
http://www.telerik.com/community/forums/aspnet-mvc/datepicker/adding-a-css-class-through-inputhtmlattributes.aspx
In short, I need to ignore jquery validation based off certain criteria. So I attempted to use:
.InputHtmlAttributes(new { @class = "ignore1" })
In conjunction with:
<script type="text/javascript">
// Ignore those fields we don't want to validate
$(function () {
var settngs = $.data($('#PersonalTab')[0], 'validator').settings;
settngs.ignore = ".ignore1";
});
</script>
This however throws a Jquery error @ var B=A.length; Saying Length is undefined when clicking on the ComboBox, you can tell something is off by the look of the ComboBox as well.
One thing to note, is it works through JQuery:
$(document).ready(function () {
if (!$('#ddl').hasClass('ignore1')) {
$("#ddl").addClass("ignore1");
}
});
I'd like to avoid the use of unnecessary javascript function downloads. Can anyone help on this?
Thanks!
EDIT/Fix - Change InputHtmlAttributes to HiddenInputHtmlAttributes