Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation #343

Closed
adamdbradley opened this issue Dec 22, 2013 · 21 comments
Closed

Validation #343

adamdbradley opened this issue Dec 22, 2013 · 21 comments
Assignees

Comments

@adamdbradley
Copy link
Contributor

http://forum.ionicframework.com/t/how-to-mask-an-input-field-for-mobile-number/274/2

@ghost ghost assigned adamdbradley Dec 22, 2013
@adamdbradley
Copy link
Contributor Author

@somethingnew2-0
Copy link

See also #11

@adamdbradley
Copy link
Contributor Author

Side note: Sir @mlynch is working on the popup.

@malixsys
Copy link

FYI @mlynch @adamdbradley I have found an unobtrusive way of doing it while supporting angular's built-in $valid, required, ng-pattern, etc...

see

https://gist.github.com/malixsys/8721568

screenshot 2014-01-30 17 25 58

It also only validates on submit...

@adamdbradley
Copy link
Contributor Author

Cool! @bensperry whatcha think?

@jgoux
Copy link

jgoux commented Apr 29, 2014

+1
It would be great to have an easy way to customise error messages like warning / info / error in forms or something more generic.
At the moment I use the "card" tag with "item-assertive/positive" but it's not that great for this purpose.

@malixsys
Copy link

I use something like this:

        <div class="item item-icon-left topless" ng-show="hasError('user.fullname')">
          <i class="icon ion-alert-circled error"></i>
          <span>please enter 3 or more characters</span>
        </div>

see
https://gist.github.com/malixsys/11406178

@mlynch
Copy link
Contributor

mlynch commented Apr 29, 2014

Looks interesting. I don't love the solution of adding hasError to scope, but we could definitely do something here.

@malixsys
Copy link

In a framework, I agree.
This IS the scope of the form though...
It could be a directive
on-error-show="user.fullname"

@ajoslin
Copy link
Contributor

ajoslin commented Apr 29, 2014

So what's wrong with using angular:

<form name="myForm">
  <input name="myInput" required>
  <div ng-show="myForm.myInput.$error">Error!</div>
</form>

@malixsys
Copy link

This one reacts only when the user has tried to submit the form once... goes with
directive('validated')
and
directive('onValidSubmit')

@malixsys
Copy link

@adamdbradley we should have a form of mask included as well...
like https://angular-ui.github.io/ui-utils/#/mask

@perrygovier
Copy link
Contributor

Moving feature requests from GH Issues to Trello. Please continue the discussion and vote for this and other issues that are important to you here:
https://trello.com/c/CPOQhSEl/11-validation

@apavillet
Copy link

In case you don't know : Angular 1.3 introduces a lot of new features for form http://www.yearofmoo.com/2014/09/taming-forms-in-angularjs-1-3.html

@perrygovier
Copy link
Contributor

Note, we plan to move to Angular 1.3 shortly after the 1.0

@luisrudge
Copy link

Any news on the validation stuff?

@ghost
Copy link

ghost commented Feb 18, 2015

@malixsys
Copy link

I love it! Great adaptation of my original validation!!

@guillermo-varela
Copy link

Hi, as an alternative I would like to suggest using Angular-auto-validate: http://jonsamwell.github.io/angular-auto-validate/

The error messages are dynamic, so for example for max/min length the message replaces the numeric values, without having to declare each message on every field, in fact the HTML template would be clean for any validation/error markups, just the form fields. Additionally the controller no longer requires to validate the form's state, because the library won't let the form to be submitted.

It even supports i18n, message customization and validation onBlur or onChange (default).

Although this library was developed to be use with Bootstrap or Fundation, I have a working example with Ionic here: http://codepen.io/gvarela/pen/KwJdEN

Hope it helps 😄

@Fayozjon
Copy link

guillermo-varela

http://wenxuebu.com/robot-instaforex

24.03.2015, 01:36, "guillermo-varela" notifications@github.com:Hi, as an alternative I would like to suggest using Angular-auto-validate:

The error messages are dynamic, so for example for max/min length the message replaces the numeric values, without having to declare each message on every field, in fact the HTML template would be clean for any validation/error markups, just the form fields. Additionally the controller no longer requires to validate the form's state, because the library won't let the form to be submitted.

It even supports i18n, message customization and validation onBlur or onChange (default).

Although this library was developed to be use with Bootstrap or Fundation, I have a working example with Ionic here:

Hope it helps

—Reply to this email directly or .

@davidpatrick
Copy link

@adamdbradley looks like you guys have some spam in this issue. ^

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests