Date & Time States Countries Rich Text Area Dual Select Auto-Expanding Select Numbers Form Analyzer | Paul's Wrap Demo Page

Date & Time
Code | Produces | Notes
[nowrap [date.date]] | [date.date] | Today's date
[nowrap [date.date;month=3;day=16;year=1967]] | [date.date;month=3;day=16;year=1967] | Specific date
[nowrap [time.time]] | [time.time] | Current time
[nowrap [time.time]] | [time.time] | Current time
[nowrap [time.stamp]] | [time.stamp] | Timestamp
[nowrap [time.timezone]] | [time.timezone] | If site.timezone is not set (possible future thing to do) it defaults to US/Mountain
[nowrap [var time.timezone "Europe/Oslo"]] | [var time.timezone "Europe/Oslo"] | Change timezone to "Europe/Oslo"
[nowrap [time.time]] | [time.time] | Time in new timezone
[nowrap [date.select_month]] | [date.select_month] | By default, select name is "month" and values are 01-12
[nowrap [date.select_month;name="birth_month"]] | [date.select_month] | Change select name to "birth_month"
[nowrap [date.select_month;nopad=1]] | [date.select_month;nopad=1] | Don't pad digits in select
[nowrap [date.select_month;month=1]] | [date.select_month;month=1] | Show month name
[nowrap [date.select_month;mon=1]] | [date.select_month;mon=1] | Show month abbreviation
[nowrap [date.select_month;both=1]] | [date.select_month;both=1] | Show number and name
[nowrap [date.select_month;number=1;mon=1]] | [date.select_month;number=1;mon=1] | Show number and abbreviation
[nowrap [date.select_dom]] | [date.select_dom] | By default, select name is "dom" and values are 01-31
[nowrap [date.select_dom;nopad=1]] | [date.select_dom;nopad=1] | Don't pad digits in select
[nowrap [date.select_year]] | [date.select_year] | By default, select name is "year" and values are 2002-2012
[nowrap [date.select_yy]] | [date.select_yy] | By default, select name is "year" and values are 02-12
[nowrap [date.select_birthyear]] | [date.select_birthyear] | By default, select name is "birthyear" and values are 1900-1990
[nowrap [date.select_birthyy]] | [date.select_birthyy] | By default, select name is "birthyear" and values are 1900-1990
[nowrap [date.select_year;start=2000;end=2004]] | [date.select_year;start=2000;end=2004] | Change start and end years
[nowrap [date.select_date;name="start_date"]] | [date.select_date;name="start_date"] | Automatically creates selects for whole date, and uses javascript to store the combined date in a hidden variable, in the format mm-dd-yyyy. (dont_combine=1 turns off combine feature.)
[nowrap [date.select_date;name="end_date";fill="12-12-2005";to_date=1]] | [date.select_date;name="end_date";fill="12-12-2005";to_date=1] | Fill in a default date.
[nowrap [date.select_date;name="end_date2";fill="12-12-2005"]] | [date.select_date;name="end_date2";fill="12-12-2005"] | Fill in a default date.

State Pulldown
Creates a form select with states. By default, the name of the select is "state" and the values are the two-letter postal abbreviations.
Code | Produces | Notes
[nowrap [state.select]] | [state.select] | Default
[nowrap [state.select;options="name"]] | [state.select;options="name"] | Shows state names only
[nowrap [state.select;options="abbr"]] | [state.select;options="abbr"] | Shows state abreviations only
[nowrap [state.select;extras=1]] | [state.select;extras=1] | Shows additional US postal destinations (Puerto Rico, military, etc.)
[nowrap [state.select;name="billing_state"]] | [state.select;name="billing_state"] | Changes the name of the select to "billing_state"

Country Pulldown
Creates a form select with countries. By default, the name of the select is "country" and the values are the two-letter ISO abbreviations.
Code | Produces | Notes
[nowrap [country.select]] | [country.select] | Default
[nowrap [country.select;name="billing_country"]] | [country.select;name="billing_country"] | Changes the name of the select to "billing_country"

Rich Textarea
In IE 5.5+ replaces regular <TEXTAREA> with a rich text editing box. Other browsers get the normal textarea.
Code | Produces | Notes
[nowrap [gadgets.richtextarea;name="long_desc"]] | [gadgets.richtextarea;name="long_desc";] | Default
[nowrap [gadgets.richtextarea;name="longer_desc";width='500';height='300']] | [gadgets.richtextarea;name="longer_desc";width='500';height='220'] | Minimum is 415x100.
[nowrap [gadgets.richtextarea;name="a_desc";value='Here is an initial value.']] | [gadgets.richtextarea;name="a_desc";value='Here is an initial value.'] | You can pass it an initial value.

Dual Select Boxes
Creates two list boxes and allows you to move elements back and forth.
Code | Produces | Notes
    [nowrap [gadgets.dualselect;
    			options1=['<OPTION VALUE=1>One
    			<OPTION VALUE=2>Two
    			<OPTION VALUE=3>Three
    			<OPTION VALUE=4>Four
    			<OPTION VALUE=5>Five
    			<OPTION VALUE=6>Six
    			<OPTION VALUE=7>Seven
    			<OPTION VALUE=8>Eight
    			<OPTION VALUE=9>Nine
    			<OPTION VALUE=10>Ten
    			']]]
| [gadgets.dualselect; options1=['One Two Three Four Five Six Seven Eight Nine Ten ']] | Default; you must pass at least options1 (left select) or options2 (right select)
[nowrap [var a.options1=['One Two Three Four Five Six Seven Eight Nine Ten ']]] | [var a.options1=['One Two Three Four Five Six Seven Eight Nine Ten ']] | Setting variable for use in examples.
    [nowrap [gadgets.dualselect;
    			name1="left";
    			name2="right";
    			options1=a.options1;
    			single=1]]
| [gadgets.dualselect;name1="left";name2="right";options1=a.options1;single=1] | Set the select names using name1 and name2. Names MUST be unique within the form. Do not allow multiple selections. (single1/single2 also available.)
    [nowrap [gadgets.dualselect;
    			name1="left2";
    			name2="right2";
    			options1=a.options1;
    			sort1="value";
    			sort2="text"]]
| [gadgets.dualselect;name1="left2";name2="right2";options1=a.options1;sort1="value";sort2="text"] | Show sort buttons and sort select 1 by values, sort select 2 by text. Can also set both sorts by just using sort="text" or "value".
    [nowrap [gadgets.dualselect;
    			name1="left2a";
    			name2="right2a";
    			options1=a.options1;
    			selectall=1;
    			sort2="text"]]
| [gadgets.dualselect; name1="left2a"; name2="right2a"; options1=a.options1; selectall=1; sort2="text"] | selectall/selectall1/selectall2 creates a "Select All" button for the select.
    [nowrap [gadgets.dualselect;
    			name1="left3";
    			name2="right3";
    			options1=a.options1;
    			autosort1="value";
    			autosort2="text"]]
| [gadgets.dualselect;name1="lef3t";name2="right3";options1=a.options1;autosort1="value";autosort2="text"] | Autosort select 1 by values, autosort select 2 by text. Can also set both to autosort by just using autosort="text" or "value".
    [nowrap [gadgets.dualselect;
    			name1="left4";
    			name2="right4";
    			options1=a.options1;
    			autosort1="value";
    			sort2="text";
    			updown2=1;]]
| [gadgets.dualselect; name1="left4"; name2="right4"; options1=a.options1; autosort1="value"; sort2="text"; updown2=1;] | Autosort select 1 by values, allow button to sort select 2 by text, also allow buttons to move items in select 2 up or down. (updown/updown1 also available.)
    [nowrap [gadgets.dualselect;
    			name1="left4a";
    			name2="right4a";
    			options1=a.options1;
    			topbottom=1;
    			sort2="text";
    			updown2=1;]]
| [gadgets.dualselect; name1="left4a"; name2="right4a"; options1=a.options1; topbottom=1; sort2="text"; updown2=1;] | In addition to up and down buttons, topbottom/topbottom1/topbottom2 provides buttons moving item to top or bottom of list.
    [nowrap [gadgets.dualselect;
    			name1="left5";
    			name2="right5";
    			options1=a.options1;
    			size=5;
    			autowidth1=1;
    			width2=150]]
| [gadgets.dualselect; name1="left5"; name2="right5"; options1=a.options1; size=5; autowidth1=1; width2=150] | Set number of lines to show with size/size1/size2, allow select to set its width by its contents using autowidth/autowidth1/autowidth2, specify pixel width using width/width1/width2 (doesn't work in all browsers)
    [nowrap [gadgets.dualselect;
    			name1="left6";
    			name2="right6";
    			options1=a.options1;
    			rightvalue=["Move &gt;&gt;"];
    			leftvalue=["&lt;&lt; Move"];
    			upvalue=["Up"];
    			downvalue=["Down"];
    			topvalue=["Top"];
    			bottomvalue=["Bottom"];
    			topbottom2=1]]
| [gadgets.dualselect; name1="left6"; name2="right6"; options1=a.options1; rightvalue=["Move >>"]; leftvalue=["<< Move"]; upvalue=["Up"]; downvalue=["Down"]; topvalue=["Top"]; bottomvalue=["Bottom"]; topbottom2=1] | Use text buttons instead of graphical arrows by specifying the value of the button.

Autoexpanding Select
This is only certified to work in IE. Other browsers should just get a regular select. Basically, it deals with the problem of very wide pulldowns that need to fit in a narrower space.
Code | Produces | Notes
    [nowrap [gadgets.selectexpander;
          options=country.options]]
| [gadgets.selectexpander; options=country.options] | Default; you must pass at least options
    [nowrap [gadgets.selectexpander;
          options=country.options;name='some_countries']]
| [gadgets.selectexpander; options=country.options;name='some_countries'] | Set the select's name
    [nowrap [gadgets.selectexpander;
          options=country.options;name='other_countries';width='200px']]
| [gadgets.selectexpander; options=country.options;name='other_countries';width='200px'] | Set the width

Numbers
Number formatting
Code | Produces | Notes
[nowrap [numbers.decimal]] | [numbers.decimal] | Character used as decimal point
[nowrap [numbers.divider]] | [numbers.divider] | Character used as thousands divider
[nowrap [numbers.places]] | [numbers.places] | Number of decimal places to use by default
[nowrap [numbers.makenice;number=1.6789]] | [numbers.makenice;number=1.6789] | Make a number (under 1,000,000,000,000) look nice
[nowrap [numbers.makenice;number=12.6789]] | [numbers.makenice;number=12.6789] | Make a number (under 1,000,000,000,000) look nice
[nowrap [numbers.makenice;number=123.6789]] | [numbers.makenice;number=123.6789] | Make a number (under 1,000,000,000,000) look nice
[nowrap [numbers.makenice;number=1234.6789]] | [numbers.makenice;number=1234.6789] | Make a number (under 1,000,000,000,000) look nice
[nowrap [numbers.makenice;number=12345.6789]] | [numbers.makenice;number=12345.6789] | Make a number (under 1,000,000,000,000) look nice
[nowrap [numbers.makenice;number=-12345.6789]] | [numbers.makenice;number=-12345.6789] | Make a number (under 1,000,000,000,000) look nice
[nowrap [numbers.makenice;places=1;decimal="_";divider="/";number=12345.6789]] | [numbers.makenice;places=1;decimal="_";divider="/";number=12345.6789] | Change places, decimal point, divider

Form Analyzer
This is a javascript that will analyze all the forms on a page and give you all the elements. Just place the code at the end of the document. It only works on Alpha unless you force it to work elsewhere.
Code | Notes
[nowrap [javascript.form_analyze]] |
[nowrap [javascript.form_analyze;force=1]] | Forces it to work on beta and live