Disable CallOut Validator
One of inconveniences is when you disable your target validator control by JavaScript (4 example, call ValidatorEnable(targetValidateControl, false)) the callout validator popup still shows every time you focus to the control.
Here's the solution to fix this issuer :
1.Set CSS class for ValidatorCalloutExtender:
HTML Code:
<style id = "style1" type="text/css">
.CustomValidator
{
position: relative;
margin-left: -80px;
margin-top: 8px;
display: inherit;
}
</style>
<ajax:ValidatorCalloutExtender ID="ProductIncrementVE" runat="server"
TargetControlID="ProductIncrementValidator"
HighlightCssClass="validator"
WarningIconImageUrl="~/img/blank.gif"
CssClass="CustomValidator">
</ajax:ValidatorCalloutExtender>
Mã:
function alterDisplay(type) {
var styleSheet, cssRule;
if (document.styleSheets) {
styleSheet = document.styleSheets[index1];
if (styleSheet) {
if (styleSheet.cssRules)
cssRule = styleSheet.cssRules[index2]; // Firefox
else if (styleSheet.rules)
cssRule = styleSheet.rules[index2]; // IE
if (cssRule) {
cssRule.style.display = type;
}
}
}
}
Hope they fix this problem in next release.
1 comments:
We can find right css instant in styleSheets array via it ID:
styleSheet = document.styleSheets["CUSIPStyle"];
Post a Comment