HI, Is it possible to reuse Umbraco out of box Validation methods. I know how to validate textbox, email, Integer using Regex in user control. I am looking to validate Email, RemoveSpecialCharacter from textbox or other available methods to validate field using Umbraco out of box methods in Usercontrol.
- Remover special character from Input Textbox and return.
- Validate Email and Check input data is Interger or not?
Well...on your document type you can add a validation rule for the specific property you make in the "validation" box.
If you for instance create a textfield, which should only contain a correctly formatted e-mail address then you can write a regular expression that makes sure what is entered is only a valid e-mail address.
If you enter something that is not a valid e-mail address the value will not be saved and you will receive a warning that the e-mail format is not correct when trying to save the value in the content section in the backoffice.
How to reuse Umbraco out of box Validations
HI, Is it possible to reuse Umbraco out of box Validation methods. I know how to validate textbox, email, Integer using Regex in user control. I am looking to validate Email, RemoveSpecialCharacter from textbox or other available methods to validate field using Umbraco out of box methods in Usercontrol.
- Remover special character from Input Textbox and return.
- Validate Email and Check input data is Interger or not?
Any Idea?
thanks.
Hi Jeevan
Do you want to use the same regular expressions as those you can use on properties in Umbraco in your usercontrol?
/Jan
HI, jan, thanks for your replay.
can you provide one example ?
Hi Jeevan
Well...on your document type you can add a validation rule for the specific property you make in the "validation" box.
If you for instance create a textfield, which should only contain a correctly formatted e-mail address then you can write a regular expression that makes sure what is entered is only a valid e-mail address.
If you enter something that is not a valid e-mail address the value will not be saved and you will receive a warning that the e-mail format is not correct when trying to save the value in the content section in the backoffice.
Hope this makes sense.
/Jan
is working on a reply...