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

Value submitted is 'value' of text-input, not data-val #64

Closed
mattholtom opened this issue Oct 4, 2017 · 1 comment
Closed

Value submitted is 'value' of text-input, not data-val #64

mattholtom opened this issue Oct 4, 2017 · 1 comment

Comments

@mattholtom
Copy link

When I submit a form containing your plugin example, the value sent to the server is 'Russia', not 'RU'.

Is this intended behaviour or am I misusing the plugin? Do I need to modify the form-submit using javascript or is normal HTTP form submission possible with this plugin.

My use case is Month selection

{January}
{February} etc.

But the value I want submitted to the server is 1, or 2

Thanks for your work,

@alexbananabob
Copy link
Collaborator

Hello, Mattholtom
Thank you for your question.
As you can see in markup in Readme file getmdl-select is a simple <input/> which works in conjunction with .mdl-menu. So with submitting form to server sends only input.value, not data-val. It is intended behaviour.

So for your task you need to read data-val attr and modify the form-submit using javascript

Good luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants