ki_ko Posted May 26, 2008 at 11:36 AM Report Share #187530 Posted May 26, 2008 at 11:36 AM Precisava de uma ajuda numa expressao para validar uma textbox em que só pode receber 3 caracteres de A a Z e tem de ser todos maiusculos. eu tou a tentar assim {A-Z}{3}, mas nao me parece tar a funcionar. Link to comment Share on other sites More sharing options...
vitortomaz Posted May 26, 2008 at 12:54 PM Report Share #187553 Posted May 26, 2008 at 12:54 PM ^[A-Z]{3}$ ValidationExpression="^[A-Z]{3}$" http://vitortomaz.blogspot.com/ Link to comment Share on other sites More sharing options...
ki_ko Posted May 26, 2008 at 01:01 PM Author Report Share #187557 Posted May 26, 2008 at 01:01 PM ok obrigado ja alterei a expressao, mas agora tou com um problema, quando introduzo mal a primeira vez ele dispara o validator , mas depois altero a expressao para uma expressao correcta e ele nao altera ou seja , continua la a mensagem de erro do validator. como resolvo isto? Link to comment Share on other sites More sharing options...
ki_ko Posted May 26, 2008 at 01:03 PM Author Report Share #187558 Posted May 26, 2008 at 01:03 PM A expressão nao está a funcionar!!! testei agora e ele dispara mesmo com uma intrudução correcta ou seja tipo :AAA Link to comment Share on other sites More sharing options...
vitortomaz Posted May 26, 2008 at 02:38 PM Report Share #187581 Posted May 26, 2008 at 02:38 PM 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> http://vitortomaz.blogspot.com/ Link to comment Share on other sites More sharing options...
ki_ko Posted May 26, 2008 at 02:53 PM Author Report Share #187584 Posted May 26, 2008 at 02:53 PM 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 More sharing options...
vitortomaz Posted May 26, 2008 at 03:07 PM Report Share #187587 Posted May 26, 2008 at 03:07 PM tira as plicas ' da validation expression http://vitortomaz.blogspot.com/ Link to comment Share on other sites More sharing options...
ki_ko Posted May 26, 2008 at 03:10 PM Author Report Share #187588 Posted May 26, 2008 at 03:10 PM porra........ erro mesmo estupido, resolvido. thanks. Link to comment Share on other sites More sharing options...
vitortomaz Posted May 26, 2008 at 03:12 PM Report Share #187589 Posted May 26, 2008 at 03:12 PM acontece... já agora mete [Resolvido] na thread http://vitortomaz.blogspot.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now