Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi
Am using Date Picker and rendering the contour form with razor but on submit i get his message "Specified cast is not valid."
I did try the preview mode but same error and when looked in the entries nothing is in.
Any idea what might be causing this ?
//fuji
Hi Fuji,
Could it be the same as problem that Pavel had some while ago. Try to see how Pavel solved the issue.
http://our.umbraco.org/forum/umbraco-pro/contour/46722-DatePicker-field-Specified-cast-is-not-valid
/Dennis
all jqueries are working fine but still nothing.
If you could tell which version of Contour and Umbraco are you using and maybe which field types your form contains, then I could try to see if I can reproduce it too.
Hi Dennis,
Am using umbraco v 4.11.8 and contour 3.0.14.
Hang on Dennis looks like its working again, i recreated the form from scratch and looks like there was a Regex in the DatePicker.
But in my transformed xslt i get the right date format i was looking for dd/mm/yyyy instead of mm/dd/yyyy.
Just like Pavel did in the post I linked to. He also remove the field and add the field again. So good that it work for you now Fuji.
Very annoying though!! :)
FYI - for other people running into the same issue, this is the only fix that worked for us:
Change the \Umbraco\plugins\umbracoContour\Views\FieldType.DatePicker.cshtml
to the following code
@model Umbraco.Forms.Mvc.Models.FieldViewModel
@{
string val = string.Empty;
if (Model.ValueAsObject != null && Model.ValueAsObject != "")
{
DateTime d;
d = Convert.ToDateTime(Model.ValueAsObject);
val = d.ToShortDateString();
}
<input type="text" name="@Model.Name" id="@Model.Id" class="datepickerfield" value="@val"
@{if (Model.Mandatory) {<text> data-val="true" data-val-required="@Model.RequiredErrorMessage"</text>}}
/>
Thanks to Craig Cronin's response here: http://issues.umbraco.org/issue/CON-382
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Specified cast is not valid
Hi
Am using Date Picker and rendering the contour form with razor but on submit i get his message "Specified cast is not valid."
I did try the preview mode but same error and when looked in the entries nothing is in.
Any idea what might be causing this ?
//fuji
Hi Fuji,
Could it be the same as problem that Pavel had some while ago. Try to see how Pavel solved the issue.
http://our.umbraco.org/forum/umbraco-pro/contour/46722-DatePicker-field-Specified-cast-is-not-valid
/Dennis
all jqueries are working fine but still nothing.
Hi Fuji,
If you could tell which version of Contour and Umbraco are you using and maybe which field types your form contains, then I could try to see if I can reproduce it too.
/Dennis
Hi Dennis,
Am using umbraco v 4.11.8 and contour 3.0.14.
Hang on Dennis looks like its working again, i recreated the form from scratch and looks like there was a Regex in the DatePicker.
But in my transformed xslt i get the right date format i was looking for dd/mm/yyyy instead of mm/dd/yyyy.
Hi Fuji,
Just like Pavel did in the post I linked to. He also remove the field and add the field again. So good that it work for you now Fuji.
/Dennis
Very annoying though!! :)
FYI - for other people running into the same issue, this is the only fix that worked for us:
Change the \Umbraco\plugins\umbracoContour\Views\FieldType.DatePicker.cshtml
to the following code
@model Umbraco.Forms.Mvc.Models.FieldViewModel
@{
string val = string.Empty;
if (Model.ValueAsObject != null && Model.ValueAsObject != "")
{
DateTime d;
d = Convert.ToDateTime(Model.ValueAsObject);
val = d.ToShortDateString();
}
}
<input type="text" name="@Model.Name" id="@Model.Id" class="datepickerfield" value="@val"
@{if (Model.Mandatory) {<text> data-val="true" data-val-required="@Model.RequiredErrorMessage"</text>}}
/>
Thanks to Craig Cronin's response here: http://issues.umbraco.org/issue/CON-382
is working on a reply...