We've added an readonly="readonly" attribute to ~/Views/Partials/Forms/Themes/default/Fieldtypes/FieldType.DatePicker.cshtml to stop let users enter text.
Instead of adding your own fieldtype, which is an good option if you want additional settings, you could also change the FieldTypeViewName property to your own view.
public class DatePicker : Umbraco.Forms.Core.Providers.FieldTypes.DatePicker
{
public DatePicker()
{
this.FieldTypeViewName = "FieldType.BootStrapDatePicker.cshtml";
}
}
umbraco forms - date picker
whats the correct way to set the date format? or is there a way to stop people from entering text?
when I enter 19/3/1970 and the following is displayed: January 1, 1753
Hi Lori,
We've added an readonly="readonly" attribute to ~/Views/Partials/Forms/Themes/default/Fieldtypes/FieldType.DatePicker.cshtml to stop let users enter text.
If you have created an theme yourself you can add this modification to your own theme to make it update-proof for upcomming Forms updates.
The date format that is applied depends on the culture settings of your site.
Best regards,
iNETZO
Hi iNETZO
I've added that in - is there any code around say if I wanted a different date picker maybe the bootstrap date picker?
https://codepen.io/Yuping/pen/xqrjE
Hi Lori,
Where you are planning to add date picker control ? if it is umbraco form, then form has different date picker control and it uses Pikaday JS library.
Yes going to try adding my own field type - client doesn't like the functionality of the otb datepicker. Says the year dropdown isnt obvious.
https://our.umbraco.com/documentation/Add-ons/umbracoforms/developer/extending/adding-a-fieldtype
Instead of adding your own fieldtype, which is an good option if you want additional settings, you could also change the FieldTypeViewName property to your own view.
just came across this option as well thanks https://our.umbraco.com/forum/using-umbraco-and-getting-started/105905-umbraco-forms-max-amt-in-numeric-field
is working on a reply...