Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When I go submit my form, if any of the validators is triggered it will remove the styles i added to some controllers. Why does this happen?


Here's an example like this RadioButtonList



<pre>
<pre><style type="text/css">
        .RadioButtonWidth label 
        {
            margin-right: 20px;
            margin-top: 15px;
            margin-bottom: 15px;
            margin-left: 5px;
            color: #142658;
            border-color: #142658;
        }

        .mGrid1 {
        }
            .mGrid1 td /* this applies to the Gridviews Data fields */ 
            {
                padding: 1px;
                margin: 15px;
                border: solid 1px #142658;
            }

            .mGrid1 th /* this applies to the Gridviews Headers */ 
            {
                padding: 1px;
                margin: 15px;
                text-align: center;
                border: solid 1px #142658;
            }
           
        body
        {
            font-family:Arial;
            font-size:10pt;
        }
        .ErrorControl
        {
            background-color: #FBE3E4;
            border: solid 1px Red;
        }

    </style>


<asp:RadioButtonList ID="rblCodeReq" CssClass="RadioButtonWidth" runat="server" RepeatDirection="Horizontal" RepeatColumns="3" BorderStyle="Solid" BorderWidth="2" BackColor="White">
                <asp:ListItem Text="Protótipo" Value="Protótipo" Style="padding-left: 15px;"></asp:ListItem>
                <asp:ListItem Text="Série" Value="Série"></asp:ListItem>
                <asp:ListItem Text="Puro Recâmbio" Value="Puro Recâmbio"></asp:ListItem>
                <asp:ListItem Text="Embalagem Alternativa" Value="Embalagem Alternativa" Style="padding-left: 15px;"></asp:ListItem>
                <asp:ListItem Text="Recâmbio" Value="Recâmbio"></asp:ListItem>
                <asp:ListItem Text="Negócio" Value="Negócio"></asp:ListItem>
                <asp:ListItem Text="Aumento Capacitário" Value="Aumento Capacitário" Style="padding-left: 15px;"></asp:ListItem>
                <asp:ListItem Text="ECR" Value="ECR"></asp:ListItem>
            </asp:RadioButtonList>


The Radio button list loses all the properties set on this style block.

What I have tried:

RequiredFieldExpression, change .ErrorControl style
Posted
Updated 30-Oct-18 2:03am
v2
Comments
F-ES Sitecore 30-Oct-18 5:38am    
It's something to do with how you've added the styles, or what they are. As you haven't told us how we can't give specific advice.
Member 14037621 30-Oct-18 8:02am    
Have added an example of what gets changed

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900