简体   繁体   English

在RequiredFieldValidator中更改属性值

[英]Changing an attribute value in a RequiredFieldValidator

I want to change the value of the Enabled attribute from false to true with javascript in an asp:RequiredFieldValidator 我想使用asp:RequiredFieldValidator中的javascript将Enabled属性的值从false更改为true

and there is it: 有:

<asp:RequiredFieldValidator  ID="rfvPropertyName"
                        Text="*" 
                        CssClass="RedText"
                        runat="server"
                        ErrorMessage="please enter your name."
                        ValidationGroup="QuerySystem"
                        ControlToValidate="txtPropertyName" Enabled="False"
                        ></asp:RequiredFieldValidator>

This will give you an overview to proceed your scenario. 这将为您提供概述以继续进行您的方案。 Let me know if you have any issues with this, 如果您有任何问题,请告诉我,

<script type="text/javascript" language="javascript" >
        function validate() {
            var vmode = document.getElementById("rfvPropertyName");
            vmode.Visibility = visible;
        }
    </script>


<asp:RequiredFieldValidator  ID="rfvPropertyName"
                    Text="*" 
                    CssClass="RedText"
                    runat="server"
                    ErrorMessage="please enter your name."
                    ValidationGroup="QuerySystem"
                    ControlToValidate="txtPropertyName" Enabled="False"
                    ></asp:RequiredFieldValidator>

<asp:RadioButton ID="radPropertyName" GroupName="Methods" runat="server" Text="Real Name" checked="true" OnClientClick = "validate()" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM