Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fuji Kusaka 2203 posts 4220 karma points
    Mar 19, 2014 @ 16:04
    Fuji Kusaka
    0

    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

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Mar 19, 2014 @ 17:12
    Dennis Aaen
    0

    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

  • Fuji Kusaka 2203 posts 4220 karma points
    Mar 19, 2014 @ 17:31
    Fuji Kusaka
    0

    all jqueries are working fine but still nothing. 

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Mar 19, 2014 @ 17:51
    Dennis Aaen
    0

    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

  • Fuji Kusaka 2203 posts 4220 karma points
    Mar 19, 2014 @ 18:28
    Fuji Kusaka
    0

    Hi Dennis,

    Am using umbraco v 4.11.8  and contour 3.0.14. 

  • Fuji Kusaka 2203 posts 4220 karma points
    Mar 19, 2014 @ 18:31
    Fuji Kusaka
    100

    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.

     

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Mar 19, 2014 @ 18:41
    Dennis Aaen
    0

    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

  • Fuji Kusaka 2203 posts 4220 karma points
    Mar 19, 2014 @ 18:43
    Fuji Kusaka
    0

    Very annoying though!! :) 

  • Zac 239 posts 541 karma points
    Jun 26, 2014 @ 20:52
    Zac
    1

    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

     
Please Sign in or register to post replies

Write your reply to:

Draft