Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added support for custom email patterns, provided via options.emailRegex.#1518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
staabm wants to merge2 commits intojquery-validation:masterfromstaabm:remail

Conversation

@staabm
Copy link
Member

Uses the current email regex per default to keep BC.

@staabmstaabmforce-pushed theremail branch 6 times, most recently from5497099 tob83cd1bCompareJuly 10, 2015 08:37
@jzaefferer
Copy link
Collaborator

I'm okay with making the email validation configurable, but I really want to avoid adding more options. Partly because there are too many already, partly because this would tie in the method even more into the core.

To take a step back, why do you need this as an option? Could you override the email method as needed? Or use a custom email method when you need to the default on the same page?

@staabm
Copy link
MemberAuthor

To take a step back, why do you need this as an option? Could you override the email method as needed? Or use a custom email method when you need to the default on the same page?

I could of course use a separate email validation method. IMO email validation will only be different in the email format and per definition will not have other differences, so I decided to go this road.

In case email method validation itself would be a separate plugin, how would I define options for it?
Maybe we can find a way which later on will be BC with what we introduce now.

Per se, I would love to reduce the jquery-validation core to less lines and have a built which only contains the rules I really need for a certain app.

Pass it via options.emailRegex.Defaults to the W3C defined pattern for BC.Fix Test CS.
@staabm
Copy link
MemberAuthor

As you already know, email pattern issues are the most reported errors in this tracker, therefore solving the issue using a config param is a must have for a lot of our users. (I am not saying it has to be a option passed to the validator).

Is separating the core from the actual methods a step which requires a BC break or do you plan to solve it in a BC compatible way?

@staabm
Copy link
MemberAuthor

@jzaefferer what do you think, how to proceed?

@staabm
Copy link
MemberAuthor

I just tried the other way you proposed.

In case we promote the$.validator.methods.<myRule> properties to be part of the public api, I could override the native-email method with my custom regex without providing another option.

example:

// setup the validation// ...// place my override$.validator.methods.email=function(value,element){returnthis.optional(element)||/whatEverRegexILike/.test(value);}

@jzaefferer wdyt?

@jzaefferer
Copy link
Collaborator

That looks good to me.

@staabmstaabm closed thisJul 21, 2015
@staabm
Copy link
MemberAuthor

will open a doc PR then, thanks.

@staabm
Copy link
MemberAuthor

@staabmstaabm deleted the remail branchJuly 21, 2015 08:51
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@staabm@jzaefferer

[8]ページ先頭

©2009-2025 Movatter.jp