-
Notifications
You must be signed in to change notification settings - Fork 532
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
Submit form on keyup/keydown #223
Comments
Can you provide more details ? |
hello @lionel-bijaoui, https://codepen.io/gabrielstuff/pen/eRZxBz Thanks ! |
I'm still not sure I get where the problem is.
If what you want is a button, you can use |
Ok, maybe I'm not clear enough. What you propose is somekind of tape on top on something that should "natively" be supported. A form + a submit button in the browser convention means when you type enter, the form is submited. |
Well, sorry if this is a "hack" for you... |
Yes ! What do you think about adding it natively to the plugin and thus support by default the listening of the keycode |
If you do that, it will have to be something deactivated by default and set with an option. Most usage of this plugin don't need a redirection or to react to I'm very curious on what you mean by "natively" and how you are going to implement this without Good luck and thank you for your participation ! |
I'm going to use addEventListener, I'm just going to make it at the module level and not for the user.
If I use template engine like vue, is to be faster and cleaner than native HTML markup... Adding addEventlistener on top of form generation is kind of rewriting again and again the browser logic.
…On 12 Jun 2017, 15:23 +0200, lionel-bijaoui ***@***.***>, wrote:
If you do that, it will have to be something deactivated by default and set with an option. Most usage of this plugin don't need a redirection or to react to enter and adding it by default would break all current implementations.
I can't guaranty that your PR will be accepted, since validation of feature depends on @icebob , the creator of this plugin.
I'm very curious on what you mean by "natively" and how you are going to implement this without addEventListener, but I will take a look at your PR with a lot of interest.
Good luck and thank you for your participation !
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
So you are going to put |
@gabrielstuff you may want to take a look at this #26 |
@gabrielstuff Any progress on this ? |
I too was surprised to find out that vue-form-generator didn't use an actual A quick modification to formGenerator.vue, changing the top-level This seems like a standard feature for a form component.
I have a branch with these changes in my fork, https://github.com/icebob/vue-form-generator/compare/master...zoul0813:feature/223-form-submit?expand=1 |
@zoul0813 VFG is far more than a form 'submission' tool. Really it is a dynamic UI renderer. Simple form submission can be handled by posting the I disagree that this should be changed to be reverse compatible with form submit. It feels like a step backward. Coupled with Vue's reactivity and a live framework like Only a few lines of code are needed to handle a traditional post and even if you did do it that way, you still need code to handle errors etc. |
I’m new to Vue, but the docs seem to imply one-way data binding with events passing data up the stack is the correct way to manage the models. Without the form providing some sort of event to listen too, how does the rest of the app know when the user is done? Requiring the user to click a button isn’t very friendly, as simple forms can be submitted with a key press traditionally. My change still has the developer implementing the form “post” code themselves, as it cancels the standard form submit event and just fires a submit event of its own to indicate the user has completed the form and is ready for the next step. Only a single event handler is needed with the suggested change I made, at which point the developer implementing the form in their project doesn’t need to work around it. The form gen exposes a validated event, just seems logical to also expose a “submit” event of some sort to indicate completion through any manner of methods. |
@zoul0813 Was there any updates to this? |
@DelfsEngineering I just wrap my After further use and consideration, I don't think VFG should implement the form itself as this would cause conflicts with forms that are composed of multiple VFG instances, or a combination of VFG and non-vfg elements. It's easy enough to just wrap the VFG tag with a
As for handling traditional forms, without relying on VFG validation (or rather, ignoring it), you can just remove the "@submit" handler and the Closing this Issue for now as it appears @lionel-bijaoui only re-opened it because @gabrielstuff was going to submit a PR (which either did not happen, or was not merged). |
Hi!
I'm trying to figure out how to send the form using keydown or keyup. Does not look to be implemented.
Thanks,
G
The text was updated successfully, but these errors were encountered: