[英]removing validators on an element using jquery
I have the below html drill down control which is generated at run time..And i want to disable all the validations on it. 我有下面的html向下钻取控件,它在运行时生成..并且我想禁用所有的验证。
<label class="mark" for="SupportTo_L1" id="SupportTo_L1_Label">select a value </label>
<select aria-labelledby="SupportTo_L1_Label SupportTo_L1_Error" aria-required="true"
class="op-combobox" data-ishorizontal="true" data-drilldowntype="true"
data-register-change-event="true" data-val="true"
data-val-required="<img class='validateicon'
src='https://sxsvc.supp.maro.com/PAdvy0.0.0/Content/Images/16x16-red-alert.png'/><font color='Red'>*</font> Required"
id="SupportTo_L1"
name="SupportTo_L1" title="Technology group involved in the project:">
<button class="submitbutton" id="submit" name="submit" type="submit"
value="submit">Submit</button>
But still it fires a validation on the this drill down when i clicked on the submit button.I tried the below code which didn't work.Anything else i need to disable. 但是当我单击提交按钮时,它仍然会在此向下钻取中触发验证。我尝试了下面的代码不起作用。我需要禁用其他任何内容。
$('#SupportTo_L1').attr(
{'data-val':'false','aria-required':'false'}
);
我是那样做的
document.getElementById("elemenId").required = false;
I would try this: 我会尝试这样的:
$('#SupportTo_L1').removeAttr('data-val');
$('#SupportTo_L1').removeAttr('aria-required');
$("#submit").click (function (e) {
e.preventDefault();
$("select.op-combobox").attr("data-val","false");
$("select.op-combobox").attr("aria-required","false");
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.