S:550 Tag Trouble

Options

I'm working on a pagebuilder page that has a year dropdown menu for credit card expiration dates.  Fortunately there's the S:550 tag that dynamically creates one for the current year and x years into the future (It can also do stuff like previous years, list ascending or descending, etc).  Unfotunately, the documentation is inconsistent and I can't get it to do what I want. I'm trying to have a dropdown that goes from the current year to seven years in the future, and given that a certain condition is true, I want the selected value to be the one seven years in the future.

The documentationsays that that there are four variables - the backwards differential, the forward diferential, the selected value, and the future value.  From what I can tell from the documentation, they are to be entered in this order.

Example from documentation

:FD=:smileyfrustrated:V=:FV=]]

I can get the list showing the seven future years with the following code...

]

I run into trouble trying to get the selected value.

The examples in the documentation are as follows...

Default Usage:

]]]

This will result in a pulldown that runs from 2009 to 2019.

Future View Usage:

]:FV=True]]

This will result in a pulldown that runs from 2019 to 2009.

Specific Year Range:

]]]

This will result in a pulldown that runs from 2009 to 2019.

The number of colons in the examples in inconsistant.  Sometimes there's a colon and the future value, sometimes there isn't.  I've been trying to use the following code as a simple test...

]

...but all it outputs is "20102011201220132014201520162017".  It's missing the tags.  I already have my code for dynamically calculating the future year (see below if you're curious) I just need to get the S:550 to work with a selected value.

Calculate Future Year

]]] ]]] length 5 - ]]] length substring 7 +]]

Tagged:

Comments

  • Hey Colin,

    You have to put the S:550 tag within a SELECT statement like (Convio folks -- please note that it'd be nice to have this in the documentation!):



    <SELECT>
    ]
    </SELECT>

    The variable number of colons is holding places for the settings you are not using.. so FD always comes after two, SV after 3, BD after only 1. If you are using SV and not FD and BD, you still have to have the colons there.

    I could not get FV to work at all.

    Adrian

  • Adrian Cotter:

    Hey Colin,

    You have to put the S:550 tag within a SELECT statement like (Convio folks -- please note that it'd be nice to have this in the documentation!):



    <SELECT>
    ]
    </SELECT>

    The variable number of colons is holding places for the settings you are not using.. so FD always comes after two, SV after 3, BD after only 1. If you are using SV and not FD and BD, you still have to have the colons there.

    I could not get FV to work at all.

    Adrian

    I'm an idiot.  I use the select tag in the other places I have it working, but I forgot to copy the lines to my test page while I was messing around.  I've got it all working now.  Full code is below if you're curious.

    Earlier in the page I set a testing variable which is the value for S80:testTransaction.  If it's true, I auto select the current year plus 7.

    <select id="card_exp_date_year" name="card_exp_date_year">

    ]::TRUE::smileyfrustrated:V=]]] ]]] length 5 - ]]] length substring 7 +]]::]]:]]

    </select>

  • Colin McClure:

    I'm an idiot.  I use the select tag in the other places I have it working, but I forgot to copy the lines to my test page while I was messing around.  I've got it all working now.  Full code is below if you're curious.

    Earlier in the page I set a testing variable which is the value for S80:testTransaction.  If it's true, I auto select the current year plus 7.

    <select id="card_exp_date_year" name="card_exp_date_year">

    ]::TRUE::smileyfrustrated:V=]]] ]]] length 5 - ]]] length substring 7 +]]::]]:]]

    </select>

    a nice little piece of code! glad its working... I've been an idiot many a time myself.

Categories