Copied to clipboard

Flag this post as spam?

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


  • Rajeev 126 posts 154 karma points
    Jul 19, 2011 @ 04:34
    Rajeev
    0

    adding validation for date data type

    5Guys,

    Is there a way to put validation for date datatype in the backend. I am thinking of creating a user control for this.

    Please let me know if there is already a control available or a better way to handle this.

    This is my need:

    I have two date fields and I have to validate between these two.

    1 - If the document is new, the first date field value shouldn't be less than today.

    2 - I have to allow second date field value always greater than first.

    Using a user control I can achieve the 2. I am not 100% sure about 1 when user trying to edit the document and when the document is new.

    Please let me know.

    Thanks in Advance

    -Rajeev

     

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Jul 19, 2011 @ 05:29
    Fuji Kusaka
    0

    HI Rajeev,

    What you can do is make a sorting in your xslt somthing like

     <xsl:sort select="current()/secondDate"  order="descending" />


    This will make sure that it will order it by using the secondDate instead of the default pusblished node

     

    Hope this helps

     

    //fuji

  • Rajeev 126 posts 154 karma points
    Jul 19, 2011 @ 07:29
    Rajeev
    0

    Hi Fuji,

    Thank you for the update. I think I was not clear enough in my question. This is for backend/editor user.

    I have a document type  which have startdate and enddate as two fields of date datatype..I would like to handle this scenario between these to data fields for backend user/editor not the end user.

    1 - If the document is new of this, the first date field value shouldn't be less than today.

    2 - I have to allow second date field value always greater than first.

    The second scenario( 2) I can handle using user control with multiple date controls, But for the first scenario I need to check if the document created is new and not saved then only I have to validate that. If you or anyone have an idea on this please let me know.

    Thanks,

    Rajeev.

     

     

Please Sign in or register to post replies

Write your reply to:

Draft