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.

[Form Validation] Support Both Old and New Syntax Mixed

See original GitHub issue

First of all, I’d like to thank you for an amazing shorthand syntax for Form Validation, that makes working with Semantic UI much more of a pleasure.

Unfortunately what seems for me to be broken is the use of full and shorthand syntax together. In cases of long form where we just want to change one of prompts (f.e. for regexp to state which signs are valid), it forces us to use old syntax all the way.

Is there a possibility to do that? Or maybe I just didn’t notice something?

Tested on Semantic UI package for Meteor, of course updated to 2.1.4

  fields: {
    password: ['minLength[5]', 'empty'],
    email: 'email',
    username: {
      identifier: 'username',
      rules: [
        {
          type: 'empty',
          prompt: 'Somehow this isn`t working'
        }
      ]
    }
  }

Error message in console:

"Form:" "There is no rule matching the one you specified" "username"
TypeError: rule.type.match is not a function

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
destancommented, Jan 20, 2016

👍 using both style together would be super.

until then document should state that Shorthand Validation and Full Validation can’t be used together.

4reactions
stale[bot]commented, Feb 24, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with Angular 4 Forms: Nesting and Input Validation
Validating user inputs is an essential part of any robust web application. Angular 4 makes it especially easy for both template-driven and reactive...
Read more >
Restrict data input by using validation rules - Microsoft Support
You can compare values across different fields using a record validation rule. For example, a record with two date fields might require that...
Read more >
Angular Custom Form Validators: Complete Guide
In this post, you will learn everything that you need to know in order to implement your own custom form validators, including both...
Read more >
yup validation on multiple values - formik - Stack Overflow
How should I write the validation schema if I want to have at least one of the fields is not empty, then that's...
Read more >
Using FluentValidation for Forms Validation in Blazor
The first is a new validator component to use in place of the DataAnnotationsValidator which comes as default. Then we need to create...
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