Jump to content

Ajuda com expressão em RegularExpressionValidator! [RESOLVIDO]


ki_ko
 Share

Recommended Posts

nos testes que fiz deu sempre bem, experimenta "^[A-Z]{3,3}$"

se não estiver a funcionar posta o código da regular expression pra se ver o que pode ser...

atenção que ele só actualiza o regular expression quando perde o focus, por exemplo click fora da caixa de texto

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
            ControlToValidate="TextBox1" ErrorMessage="RegularExpressionValidator" 
            ValidationExpression="^[A-Z]{3}$"></asp:RegularExpressionValidator>
Link to comment
Share on other sites

nao funciona . testei com AAA e ele deu logo a mensagem.

<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
                                    ControlToValidate="TextBoxEditCodArp" ErrorMessage="expressao invalida, deve conter 3 caracteres(A-Z) maiusculos."
                                    ValidationExpression='"^[A-Z]{3,3}$"'></asp:RegularExpressionValidator><br />
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.