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

The value attribute should update the hidden element value if no data-value is provided #303

Closed
amsul opened this issue Dec 19, 2013 · 1 comment

Comments

@amsul
Copy link
Owner

amsul commented Dec 19, 2013

Upon initialization, a value using the format doesn’t update the hidden element. This was purposely done to allow developers to set a default value on load while specifying hidden values using the data-value.

For example:

<input type="text" value="Unedited value: January 24, 2013" data-value="2013-24-01" />
<input type="hidden" value="2013-24-01" />

...after selecting something would change to:

<input type="text" value="January 25, 2013" data-value="2013-24-01" />
<input type="hidden" value="2013-25-01" />

However, without a data-value attribute, it should still work seamlessly.

Expected:

<input type="text" value="January 24, 2013" />
<input type="hidden" value="2013-24-01" />

Actual:

<input type="text" value="January 24, 2013" />
<input type="hidden" value="" />
@chrisdlangton
Copy link

+1

thank you.

As mentioned here data-value is for storing custom data not the standard way of storing and accessing the form input value.

@amsul amsul closed this as completed in bb009e6 Dec 29, 2013
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