Hi @hollosipeter
There is no way to input incorrect date in own format as setup from that field will show error message
Not valid dateExample: date is setup as YYYY/MM/DD. If as type DD/MM/YYYY I will see above error. This can be replicated on my lab site and on your site as well. Only difference is that you use dash instead of slash. But workflow is the same. Can you share with us more details, a video which you could share via google drive or dropbox so we could have a full light on this?
Kind Regards,
Kris
Hello Kris!
Yesterday I got 2 email with .
The common thing in both – both Android.
Maybe can you check these?
Thank you:
Peter
1.)
Mozilla/5.0 (Linux; Android 13; SM-A528B Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/110.0.5481.154 Mobile Safari/537.36 [FB_IAB/Orca-Android;FBAV/400.0.0.11.90;]
2.)
Mozilla/5.0 (Linux; Android 11; 2201116SG Build/RKQ1.211001.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/110.0.5481.153 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/406.0.0.26.90;]
I got it! I can reproduct the error!
CTRL+V / paste is allowing that without error (i tried from ios). So i think if somebody select autofill form, it gonna be happen.
Try to copy YYYY.MM.DD – you can easily paste without an error message.
Regards,
Peter
Hi @hollosipeter
Thank you for response!
You are right – I just tested it and while I cannot just “enter” such date, I can easily paste it into the field and it goes through, no matter what is the form configuration.
This would be a bug that we were not aware of yet and will need to be fixed directly in the plugin.
I have already reported it to our developers so they could address it in future releases.
As a “quick and dirty” temporary workaround, you could make the field to be “readonly”, forcing users to use the calendar – it wouldn’t let “freehand” typing and pasting.
To achieve that, simply add this code to the site as MU plugin:
<?php
add_filter( 'forminator_field_date_markup', 'forminator_date_readonly', 10, 2);
function forminator_date_readonly( $html, $field ) {
if ( strstr( $field['element_id'], 'date' ) ) {
$html = str_replace( '<input', '<input readonly ', $html );
}
return $html;
}– create an empty file with a .php extension (e.g. “forminator-datepicker-readonly.php”)
– copy and paste code into it
– save the file and upload it (e.g. using FTP) to the “/wp-content/mu-plugins” folder of your site’s WordPress installation.
Kind regards,
Adam
Thank you so much Adam, I tried it, perfect workaround! 🙂
