Add pattern property to text field schema options
See original GitHub issueA pattern
property on a string schema would then add the value to the pattern
attribute on the input field for basic enforcement of an input pattern. The native browser alert would appear, assuming Apostrophe is letting the native form submission do its work.
{
name: 'favLetter',
label: 'Favorite Letter',
type: 'string',
help: 'Enter a single capital letter',
pattern: '[A-Z]'
},
One use for this would be to update apostrophe-redirects to make sure that the “Old URL” starts with a forward slash.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (9 by maintainers)
Top Results From Across the Web
HTML input pattern Attribute - W3Schools
The pattern attribute specifies a regular expression that the <input> element's value is checked against on form submission. Note: The pattern attribute ......
Read more >Define Text Field Pattern Validation - TechDocs
The pattern attribute represents an industry standard regular expression for the format of the text field. You can also specify an optional patternmessage ......
Read more >HTML | DOM Input Text pattern Property - GeeksforGeeks
The Input Text pattern Property in HTML DOM is used to set or return the pattern attribute of an text field. It is...
Read more >HTML attribute: pattern - HTML: HyperText Markup Language
The pattern attribute is an attribute of the text, tel, email, url, password, and search input types. The pattern attribute, when specified, is ......
Read more >object — Understanding JSON Schema 2020-12 documentation
The value of properties is an object, where each key is the name of a property and each value is a schema used...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Except, pattern is indeed looking for a regular expression, so my comment on the error in the example is valid.
On Thu, Sep 20, 2018, 2:14 PM Tom Boutell tom@punkave.com wrote:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.