vuematerial / vue-material

Vue.js Framework - ready-to-use Vue components with Material Design, free forever.
https://www.creative-tim.com/vuematerial
MIT License
9.89k stars 1.16k forks source link

[md-datepicker] Please pass name attribute to inner input element #2156

Open Thaina opened 4 years ago

Thaina commented 4 years ago

For old style form submit

<form id="mainForm" :action="'add.php" method="post">
        <md-datepicker name="date" />
</form>

The datepicker does not set the name of inner input field

image

Is it possible to pass attribute name (and also all input related attribute) from datepicker to that inner input?

anurat commented 4 years ago

I assume you want to return date value from a form.
My workaround is to have another input hidden with the same value.

<form id="mainForm" :action="'add.php" method="post">
        <md-datepicker v-model="somedate" />
        <input type="hidden" name="date" :value="somedate" />
</form>

Hope this helps.

Thaina commented 4 years ago

@anurat That's what I was done so right now. which I want it to be more convenient that the datepicker itself should just let us name it directly