When using the regular expression validator is there a way of failing a
validation when you detect a match - I suppose a sort of anti-match.
I want to detect certain things on user input and if they exist then fail
client-side validation.
An example would be detecting html input, a simple test of which would be to
look for '<[a-zA-z]',
but I would like to fail if this sequence is detected anywhere in a
multiline string.
Is there a way or is it down to server-side validation only?
Shaun
PS. I am still validating the input on the server-side I just wanted to cut
down on round trips 9 2776
Hi Shaun,
Based on my understanding, you want to reverse the process logic of
RegularExpressionValidator control.
To get this done, I think you should use CustomValidator control, which
allows you to write your own code to take part in the validation framework.
Then you can provide your own validate logic on the Form.
For more information about how to use CustomValidator control, please refer
to: http://msdn.microsoft.com/library/de...us/dnaspp/html
/aspplusvalid.asp
At client side, you may use JScript's RegExp class to do the regular
expression operation. For more information, please refer to the client
Jscript souce code below: http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconscriptfileforsample.asp
In the article, RegularExpressionValidatorEvaluateIsValid method contains
the original RegularExpressionValidator control's logic. FYI.
====================================
Please apply my suggestion above and let me know if it helps resolve your
problem.
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Hi Shaun,
Based on my understanding, you want to reverse the process logic of
RegularExpressionValidator control.
To get this done, I think you should use CustomValidator control, which
allows you to write your own code to take part in the validation framework.
Then you can provide your own validate logic on the Form.
For more information about how to use CustomValidator control, please refer
to: http://msdn.microsoft.com/library/de...us/dnaspp/html
/aspplusvalid.asp
At client side, you may use JScript's RegExp class to do the regular
expression operation. For more information, please refer to the client
Jscript souce code below: http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconscriptfileforsample.asp
In the article, RegularExpressionValidatorEvaluateIsValid method contains
the original RegularExpressionValidator control's logic. FYI.
====================================
Please apply my suggestion above and let me know if it helps resolve your
problem.
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Hi Jeffrey
yup I was thinking along those lines myself as an alternative action - so
what you suggest is that I do a custom validator and then invert the result.
Seems reasonable, I was just hoping there wassome unknown regex expression I
didn't know about.
I'll test it out later and get back to you
shaun
""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:Jx**************@cpmsftngxa06.phx.gbl... Hi Shaun,
Based on my understanding, you want to reverse the process logic of RegularExpressionValidator control.
To get this done, I think you should use CustomValidator control, which allows you to write your own code to take part in the validation
framework. Then you can provide your own validate logic on the Form.
For more information about how to use CustomValidator control, please
refer to: http://msdn.microsoft.com/library/de...us/dnaspp/html /aspplusvalid.asp
At client side, you may use JScript's RegExp class to do the regular expression operation. For more information, please refer to the client Jscript souce code below: http://msdn.microsoft.com/library/de...us/cpguide/htm l/cpconscriptfileforsample.asp
In the article, RegularExpressionValidatorEvaluateIsValid method contains the original RegularExpressionValidator control's logic. FYI.
==================================== Please apply my suggestion above and let me know if it helps resolve your problem.
Thank you for your patience and cooperation. If you have any questions or concerns, please feel free to post it in the group. I am standing by to be of assistance.
Best regards, Jeffrey Tan Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "as is" with no warranties and confers no rights.
Hi Jeffrey
yup I was thinking along those lines myself as an alternative action - so
what you suggest is that I do a custom validator and then invert the result.
Seems reasonable, I was just hoping there wassome unknown regex expression I
didn't know about.
I'll test it out later and get back to you
shaun
""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:Jx**************@cpmsftngxa06.phx.gbl... Hi Shaun,
Based on my understanding, you want to reverse the process logic of RegularExpressionValidator control.
To get this done, I think you should use CustomValidator control, which allows you to write your own code to take part in the validation
framework. Then you can provide your own validate logic on the Form.
For more information about how to use CustomValidator control, please
refer to: http://msdn.microsoft.com/library/de...us/dnaspp/html /aspplusvalid.asp
At client side, you may use JScript's RegExp class to do the regular expression operation. For more information, please refer to the client Jscript souce code below: http://msdn.microsoft.com/library/de...us/cpguide/htm l/cpconscriptfileforsample.asp
In the article, RegularExpressionValidatorEvaluateIsValid method contains the original RegularExpressionValidator control's logic. FYI.
==================================== Please apply my suggestion above and let me know if it helps resolve your problem.
Thank you for your patience and cooperation. If you have any questions or concerns, please feel free to post it in the group. I am standing by to be of assistance.
Best regards, Jeffrey Tan Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "as is" with no warranties and confers no rights.
Hi Shaun,
Thanks for your feedback.
Yes, the key point is how to do the do the validation through regular
expression at client.
I will wait for your feedback. Thanks
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Hi Shaun,
Thanks for your feedback.
Yes, the key point is how to do the do the validation through regular
expression at client.
I will wait for your feedback. Thanks
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Hi Shaun,
Here's an alternative solution. My product "Professional Validation And
More" (at http://www.peterblum.com/vam/home.aspx) is a replacement to the
built in validators that overcomes their numerous limitations. For example,
all of my 22 validators have a property called NotCondition that when true,
reverses the logic. So you'd plug in my RegexValidator, set the expression
that you want to be false and set NotCondition to true.
This works fully on the client side and my validators support more browsers
for client-side validation than Microsofts. (They support DHTML only; I
support IE, IE/Mac, Netscape/Mozilla, Opera 7, and Safari.)
--- Peter Blum www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at http://www.peterblum.com/vam/home.aspx
"Shaun Wilde" <sh*********@nospam.co.uk> wrote in message
news:OH*************@TK2MSFTNGP09.phx.gbl... When using the regular expression validator is there a way of failing a validation when you detect a match - I suppose a sort of anti-match.
I want to detect certain things on user input and if they exist then fail client-side validation.
An example would be detecting html input, a simple test of which would be
to look for '<[a-zA-z]', but I would like to fail if this sequence is detected anywhere in a multiline string.
Is there a way or is it down to server-side validation only?
Shaun
PS. I am still validating the input on the server-side I just wanted to
cut down on round trips
Hi Shaun,
Here's an alternative solution. My product "Professional Validation And
More" (at http://www.peterblum.com/vam/home.aspx) is a replacement to the
built in validators that overcomes their numerous limitations. For example,
all of my 22 validators have a property called NotCondition that when true,
reverses the logic. So you'd plug in my RegexValidator, set the expression
that you want to be false and set NotCondition to true.
This works fully on the client side and my validators support more browsers
for client-side validation than Microsofts. (They support DHTML only; I
support IE, IE/Mac, Netscape/Mozilla, Opera 7, and Safari.)
--- Peter Blum www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at http://www.peterblum.com/vam/home.aspx
"Shaun Wilde" <sh*********@nospam.co.uk> wrote in message
news:OH*************@TK2MSFTNGP09.phx.gbl... When using the regular expression validator is there a way of failing a validation when you detect a match - I suppose a sort of anti-match.
I want to detect certain things on user input and if they exist then fail client-side validation.
An example would be detecting html input, a simple test of which would be
to look for '<[a-zA-z]', but I would like to fail if this sequence is detected anywhere in a multiline string.
Is there a way or is it down to server-side validation only?
Shaun
PS. I am still validating the input on the server-side I just wanted to
cut down on round trips
Hi Shaun,
Have you tried it yet? Do you still have any concern?
Please feel free to let me know, I will help you. Thanks
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Fazer |
last post by:
Hello,
I have a string which has a url (Begins with a http://) somewhere in
it. I want to detect such a url and just spit out the url. Since I
am very poor in regex, can someone show me how to...
|
by: a |
last post by:
I'm a newbie needing to use some Regular Expressions in PHP.
Can I safely use the results of my tests using 'The Regex Coach'
(http://www.weitz.de/regex-coach/index.html)
Are the Regular...
|
by: jwgoerlich |
last post by:
Hello group,
I am working on a query string class. The purpose is to parse
name-value pairs from incoming text. Currently, I am using the Regex
code below. I have two questions.
First, the...
|
by: =?ISO-8859-15?Q?C=E9dric?= |
last post by:
Hi all,
I want to import a SQL script (SQLite) executing each queries separately.
- I read the SQL file
- I split the read string with the separator ";"
- I execute each query
string query...
|
by: nagar |
last post by:
I need to split a string whenever a separator string is present (lets
sey #Key(val) where val is a variable) and rejoin it in the proper
order after doing some processing.
Is there a way to use...
|
by: rmccullough |
last post by:
The test tool I use produces xml files that I am parsing and inserting into a mysql database. I then have a set of php pages that report on the test results.
I wrote a C# console application that...
|
by: Guoqi Zheng |
last post by:
Dear Sir, I need to use regex to replace some string.
Below is what I use.
output = "sample data <href=""xlink:GG44-33"">, part two
<href=""xlink:GG55-123"">"
Dim regEx
Set regEx = New...
|
by: vmysore |
last post by:
I am trying to get all the columns selected within a SQL query (including the sub selects). When the code hits matcher.find(). i get the following exception:
Exception in thread "main"...
|
by: =?Utf-8?B?anAybXNmdA==?= |
last post by:
Prior to now, my RegEx expression was as follows:
RegEx pattern = new Regex(@"\d{5} \d{4} \d{2}");
That has worked, but now I have been asked to enable the ability for our
expressions to...
|
by: Smokey Grindel |
last post by:
I basically need to remove any leading zeros and hyphens from a string...
regex seemed like the best rout and using a replace regex method... anyone
know of any good strings for this? The one I...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |