Year Select

Print a select dropdown of years, starting from the current year.

Table of Contents

Parameters

years

The number of years to print out in the select. Defaults to 5.

years="5"
start_year

The year to start with. (use 4 character years). If left blank, the current year will be used.

start_year="1979"

selected

The selected customer expiration year.

selected="{customer_expiration_year}"
name

Set the form input name, i.e. gateway. if not set, defaults to “expiration_year

name="expiration_year"
extra

Any extra tag data you’d like to add.

extra='rel="my_attr" title="my title"'
id

CSS id of your form. This is an arbitrary value.

id=""
class

CSS class of your form. This is an arbitrary value.

class=""
onchange

Optional javascript function to run when the select changes.

onchange="your_custom_javascript()"

Examples

{exp:cartthrob:year_select years="6"}