You are here

README.txt in Form API Validation 8

Same filename and directory in other branches
  1. 7.2 README.txt
@TODO: Improve this readme file for D8! This is old D7 text!

This module drastically increase the validation power of Drupal Form API (FAPI).
You can use the existent filters and rules or create your own. It is up to you!

For the most information, visit the project documenation.


rules 			Usage						Description
------------------------------------------------------
numeric 			numeric 			Must contains only numbers.

alpha 				alpha 				Must contains only alpha characters.

length				length[<total>]
							length[<min>, <max>]
							length[<min>, *] 	

chars 				chars[<char 1>, <char 2>, ..., <char N>] 
														Accept only specified characters.

email 				email 				Valid email

url 					url
							url[absolute] Valid URL. If absolute parameter is specified,
														the field value must have to be a full URL.

ipv4 					ipv4 					Valid IPv4

alpha_numeric alpha_numeric Accept only Alpha Numeric characters

alpha_dash 		alpha_dash 		Accept only Alpha characters and Dash ( - )

digit 				digit					Checks wheter a string consists of digits only (no dots or dashes).

decimal 			decimal
							decimal[<digits>,<decimals>]

limit_decimals
							limit_decimals[2]
														Only allows X deicmal places.

regexp 				regexp[/^regular expression$/] 
														PCRE Regular Expression

match_field 	match_field[otherfield] 	
														Check if the field has same value of otherfield.

range 	range[<min>, <max>] Check if the field value is in defined range.



Filters					Description
----------------------------------------------------------------------
numeric 				Remove all non numeric characters.
trim 						Remove all spaces before and after value.
uppercase 			Transform all characters to upper case.
lowercase 			Transform all characters to lower case.
strip_tags			Uses PHP's strip_tags()
html_entities 	Encodes all entities such as & to &amp;

File

README.txt
View source
  1. @TODO: Improve this readme file for D8! This is old D7 text!
  2. This module drastically increase the validation power of Drupal Form API (FAPI).
  3. You can use the existent filters and rules or create your own. It is up to you!
  4. For the most information, visit the project documenation.
  5. rules Usage Description
  6. ------------------------------------------------------
  7. numeric numeric Must contains only numbers.
  8. alpha alpha Must contains only alpha characters.
  9. length length[]
  10. length[, ]
  11. length[, *]
  12. chars chars[, , ..., ]
  13. Accept only specified characters.
  14. email email Valid email
  15. url url
  16. url[absolute] Valid URL. If absolute parameter is specified,
  17. the field value must have to be a full URL.
  18. ipv4 ipv4 Valid IPv4
  19. alpha_numeric alpha_numeric Accept only Alpha Numeric characters
  20. alpha_dash alpha_dash Accept only Alpha characters and Dash ( - )
  21. digit digit Checks wheter a string consists of digits only (no dots or dashes).
  22. decimal decimal
  23. decimal[,]
  24. limit_decimals
  25. limit_decimals[2]
  26. Only allows X deicmal places.
  27. regexp regexp[/^regular expression$/]
  28. PCRE Regular Expression
  29. match_field match_field[otherfield]
  30. Check if the field has same value of otherfield.
  31. range range[, ] Check if the field value is in defined range.
  32. Filters Description
  33. ----------------------------------------------------------------------
  34. numeric Remove all non numeric characters.
  35. trim Remove all spaces before and after value.
  36. uppercase Transform all characters to upper case.
  37. lowercase Transform all characters to lower case.
  38. strip_tags Uses PHP's strip_tags()
  39. html_entities Encodes all entities such as & to &