question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add pattern property to text field schema options

See original GitHub issue

A 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:closed
  • Created 5 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
boutellcommented, Sep 20, 2018

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:

Ah. I wasn’t aware of it.

On Thu, Sep 20, 2018, 2:13 PM Alex Bea notifications@github.com wrote:

Why do you say that, @houmark https://github.com/houmark? If mobile devices change their keyboards based on the input attributes to make entering easier for people, why not let them do that here too?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/apostrophecms/apostrophe/issues/1633#issuecomment-423281588, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB9fY5swLkKnJx2H96Ubc5BpJZpmOlXks5uc9q8gaJpZM4WyY4D .

0reactions
stale[bot]commented, Jun 19, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found