-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: unable to validate input field in Alert prompt #5916
Comments
@Dheran Hello! Would you be able to provide some more information for this issue?And maybe a codepen or plunker of the code you have so far? Thanks! |
@Dheran Hey! So im not sure why you sent me a link to our alert documentation but maybe im just not following correctly. At this point im not sure if your having a bug with it, or just generally asking how to do it. We need to be able to see what code you have right now so that i know which way to point you on this, thats why i asked for a codepen or plunker of what you have so far. You can read about how to do it here: https://angular.io/docs/ts/latest/guide/forms.html and if you can get a codepen together then i would be glad to help you get it working. Thanks again! |
I'm mentioning about Alert which is an ionic component.
|
Hello! While we appreciate you opening an issue with us i am going to close this issue and ask that you open a new one that has the issue template filled out please. Thanks for using Ionic! |
I have an example in this Plunker, open prompt and submit without providing an email. Lets say I prompt the user to enter an email address it would be a good idea to validate the input and add the necessary validation classes to it or event display an error message so the user can see if something is not valid. In my plunker I could custom validate the inputs in the .ts file of the click handler like so
but like I said, how do I then feed this back to the user similar to the normal material design form input validation and errors. One idea would be to have more options when setting up the inputs, maybe provide an array of validators and error messages associated with them? I guess you can consider this as a how to question but if things can be simplified by the framework is it worth considering it as a feature request |
@jgw96 can this be re-opened based on the example I provided? After plenty of research in the last day it seems near impossible to do anything similar to what I want so should I create a new issue as a feature request? |
Hello (: this is actually already on the roadmap for beta.12. Feel free to post about the alert component on that issue. Thanks for using Ionic! |
@jgw96 I see this as a separate issue. My reason being that if you inspect the input elements inside the alert prompt you will notice they are not wrapped inside a form. So it seems like a lot of work will be required for the alert prompt in order to get validation working on them properly, that is why I suggested raising it as a new feature request. Alternatively, I can just post my problem on the issue you just linked. What do you think? |
Hmmm at this time i would post on that issue, as that is the validation issue. Then once we get closer to beta.12 i can always split it out to a different issue if needed. Does that work for you? (: |
Sounds good to me :) |
I think what he is saying is that we should be able to perform some kind of input validation before activating the button and a way to display a warning message. |
Looks like this issue has been dropped from the watch list, even though it is not at all like in the suggested issue. |
@jgw96 Is their any solution to the above problem found,
} |
@georgethomas2015e: You can validate it through the Edit Button handler, the question here is how to interact with the user in order to tell him/her whether something is wrong without dismissing the alert. |
@paishin yeah buddy, that's the thing, you got any solutions here? |
@WHarris22 Have you found any solution for this issue? |
@clubs this is not validation, it's just displaying a message outside of the modal context, definitely not what we are asking |
Now I am using this way out, set a timeout at
|
|
@meddlesome nice try, but alert again cost too much and user-unfriendly, you got any other solutions that disable the 'OK' button when data is invalid? |
@barakbd good attempt!! can I have a plunkr of yours code ?, is there any other solution found to validate the alert prompt value ? |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
ionic v2
provide the workaround to validate the input filed in alert prompt
The text was updated successfully, but these errors were encountered: