Announcement

Collapse
No announcement yet.

Date Info - default value

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

    Date Info - default value

    Hi,

    Can anyone tell me if there is a clever method of getting the Date Info field in the product page to default to today's date +2 days. The reason is it currently defaults to 1st January 2005 and if left unaltered by the customer this is clearly not a sensible delivery date(!)

    Any help would be much appreciated. This is my first post so please forgive any naivety in the question and be gentle with me!

    Many thanks....
    http://thecandlelightcompany.co.uk
    http://thenaturallivingcompanyco.uk

    #2
    Hi Ian

    There was a discussion before regarding the date value. A client wanted to have it blank and let the customer choose the date. At the end though the client just used the other info prompt so their customer can confirm what the delivery date would be. Here is the thread.

    Kind Regards
    Nadeem Rasool
    SellerDeck Development

    Comment


      #3
      If you know JavaScript it should be possible to preset the SELECT fields containing the date to today + 2. Look at the source of a generated page to see what needs manipulating. E.g. for productreference 003931

      <SELECT NAME="DAY_003931" SIZE=1>
      .
      .
      <SELECT NAME="M_003931" SIZE=1>
      .
      .
      <SELECT NAME="Y_003931" SIZE=1>

      you can use NETQUOTEVAR:PRODUCTREFERENCE to get the raw product reference. So some JavaScript in your product template (after the Date Prompt) like

      today = new Date();
      presetdate('NETQUOTEVAR:PRODUCTREFERENCE', today);

      The hard work is writing presetdate. It will have to scan all form fields until it finds one like DAY_<ref> and preset that to today + 2 taking the number of days in each month in account, likewise rolling over the month ( M_<ref> ) and year ( Y_<ref> ) if required.

      Remember that all this is dependent on the customers browser clock being set correctly.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Thanks

        Nadeem/Norman,

        Many thanks for your help/advice, I'm sure I can find a way around this now.

        Ian.
        http://thecandlelightcompany.co.uk
        http://thenaturallivingcompanyco.uk

        Comment


          #5
          Just be careful not to use document.getElmentById to access these fields as this will fail in Netscape / Firefox (these fields don't have an ID= tag and not all browsers use the NAME= as an alternative if the ID isn't there).
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment

          Working...
          X