Topic: New Datepicker doesn't work - Get submit value
mdw free asked 4 years ago
Expected behavior
Need to get the datepicker value after form submit. Impossible to get the post value after submit. When you choose a date the hidden input stay empty Impossible to change the "undefined" name for the input value.
Another question.
Is it possible to update the hidden input value and calendar with manual entry. For example, instead of clicking on the icon, allow user to write directly in input with regex. 15/05/2020 -> update date picker calendar and hidden input.
Actual behavior
Resources (screenshots, code snippets etc.)
$('.datepicker').datepicker({ // Escape any “rule” characters with an exclamation mark (!). format: 'dd/mm/yyyy', formatSubmit: 'yyyy-mm-dd', hiddenPrefix: '', hiddenSuffix: '_submit', hiddenName: 'date' })
rockland free answered 4 years ago
in src code mdb.js.datepicker line 8800-ish (version MDB-Pro_4.19.0):
function o(e, n, c, h) ... a little further down ... b = y.prototype = { constructor: y, $node: v, start: function() { // --> parameter 'e' is not referencing input element but div-wrapper //--> set 'e' to input object e = b.$node[0];
// everything works, hidden input name, hidden submit etc
Grzegorz Bujański staff commented 4 years ago
Hi. Thanks. We'll check it
davewalker priority commented 4 years ago
Is there any ETA for when this fix will be done?
Grzegorz Bujański staff commented 4 years ago
Unfortunately at the moment we are unable to say when this will be done.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.18.0
- Device: All
- Browser: All
- OS: All
- Provided sample code: No
- Provided link: No
Grzegorz Bujański staff commented 4 years ago
Hi. About getting the datepicker value after submitting the form - we will check this and fix. About manual entry - this functionality is not currently supported.
mdw free commented 4 years ago
Ok thank's for your reply. Do you have an idea when the update will be made ?
Can you tell me why you need to click on the calendar icon in the new version ? This way is not very comprehensive for user. Is it possible to open the calendar on input click event ?
The user write the date directly in the input without clicking on calendar icon. For validation plugin you need to remove the readonly attribute so user write directly in the input...
Waiting for your reply,
Grzegorz Bujański staff commented 4 years ago
I can't tell now when this will be fixed. In the new date picker, we've decided to change the way the date picker opens to make it consistent with material design. If you would like the date picker to open after clicking on input, you can always trigger click on icon after user click on input. By default, this behavior cannot be changed at the moment.