Announcement

Collapse
No announcement yet.

Can I have the date prompt show tomorrow's date by default?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can I have the date prompt show tomorrow's date by default?

    You need to use javascript to do this.

    On your product layout(s) look for:



    Create a new line before '/block' and add the following javascript code:

    <script language="javascript" type="text/javascript">
    var date = new Date();
    date.setDate( date.getDate() + 7 );
    var year = date.getFullYear();
    var month = date.getMonth();
    var day = date.getDate();

    document.getElementsByName('Y_<Actinic:Variable Name="ProductID"/>')[0].selectedIndex = year - <actinic:variable name="MinYearValue" />;
    document.getElementsByName('M_<Actinic:Variable Name="ProductID"/>')[0].selectedIndex = month;
    document.getElementsByName('DAY_<Actinic:Variable Name="ProductID"/>')[0].selectedIndex = day-1;
    </script>

    Click 'Apply' and update your site.

    If you want to make the date longer (ie a week from today's date) then change '+ 1' to the number of days you want in the future.
    Attached Files
Working...
X