Tagged: validation
- This topic has 3 replies, 2 voices, and was last updated 7 years, 2 months ago by
Jason.
Viewing 3 reply threads
-
AuthorPosts
-
-
December 5, 2014 at 10:31 am #2969
JasonKeymasterHere’s a simple address group:
piklist('field', array( 'type' => 'group', 'field' => 'address', 'template'=> 'field', 'fields' => array( array( 'type' => 'text', 'field' => 'street', 'label' => 'Street Address', 'columns' => 12 ), array( 'type' => 'text', 'field' => 'city', 'label' => 'City', 'columns' => 4 ), array( 'type' => 'select', 'field' => 'state', 'label' => 'State', 'choices' => $states, 'columns' => 4 ), array( 'type' => 'text', 'field' => 'zip', 'label' => 'Zip Code', 'columns' => 4, 'validate'=> array( 'type' => 'zip-code' ) ) ) ));The code for the zip-code type can be found here: https://github.com/JasonTheAdams/PiklistHelper/blob/master/PiklistHelper.php#L88
I have had issues with validations in the past being finicky — in that they don’t always work. I’m not sure if something was changed that broke my old code, but the docs don’t seem to have changed.
-
December 5, 2014 at 11:06 am #2970
-
December 5, 2014 at 11:16 am #2971
JasonKeymaster -
December 5, 2014 at 11:21 am #2972
JasonKeymasterAnd, to clarify, when I say “not work” I mean that the validation never fails.
-
-
AuthorPosts
Viewing 3 reply threads
- You must be logged in to reply to this topic.