Validating special characters
Below you can find the demo and download of the demonstration.
DEMO | DOWNLOAD The validation formula we use here is simple. HTML Markup: <form name="my Form" action="#" method="post" onsubmit="validate()"> <ul><li> <label> Field No 1 </label><input type="text" name="field1" size="15"/></li> <li> <label> Field No 2 </label><input type="text" name="field2" size="15"/></li> </ul> <button type="submit" value="submit"> Submit</button> </form> The form above has something called as a onsubmit attribute in the form tag.
Finally, i somehow got hold of the code that does the job through regular expression regex that checks for only numbers and a-z Mr.
Balakrishnan Prabhu is the founder of Corpocrat magazine.
I also need to validate if someone enters the Ampersand sign, and the pound sign.
I can't figure out how to allow for validation of the & and #. Below is my current regular expression var char Validation = new Regex(@"^[a-z A-Z]"); You probably also want to tack on the "end of string" marker as well ( $ ). Hey I tried what you suggested and it does not work? var validator = new Regex(@"^[a-z A-z]"); if(validator.
Otherwise, the form reaching you may have junk data and inappropriate contents.Hi , thank you for your post, but there is a faster way to validate special character like the following: System. * // other characters used in the regular expression are part of regex syntax. I have a regular expression to validate upper and lower case letters.Normally I call this class by Overriding the method Validate Field() from table.For example, I have used the Table Logistics Eletronic Address which is responsible to save contact information like e-mail and telephone. *]*$’); // return true if name matches the criteria otherwise return false is Valid = reg Ex Match.get_Success(); Regards, Bilal Yes, I think the biggest advantage is being able to define our own character set.
I will check if I am validating the field Locator and then call my class. This is my class: I have used all the special characters that I know of but feel free to add as much as your client requires :). However there is a glitch(or not) where the method does not take into account specific characters from a language such as Portuguese where it does not filter cedilla(Ç).