Lasso Soft Inc. > Home

[State_Select]

LinkState_Select
AuthorJeremy Schwartz
CategoryCustom Tag
Version7.x
LicensePublic Domain
Posted23 Jan 2006
Updated24 Jan 2006
More by this author...

Description

Creates a select menu of states for use within a form. Takes three optional values: 1. Fieldname: allows you to set the name of the field 2. State: takes a 2 letter state abbr. as the selected item 3. Statename: takes a full statename as the selected item

Sample Usage

[state_select: -fieldname='your_state', -state='fl']

or 

[state_select: -fieldname='your_state', -statename='florida']

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

/*====================================================================*\

	Tagname: state_select
	Date: January 23, 2006
	Author: Jeremy Schwartz
	
	Description: Creates a select, pulldown menu of states for use 
		within a form. Takes three optional values:
		
		1. Fieldname: allows you to set the name of the field
		2. State: takes a 2 letter state abbr. as the selected item
		3. Statename: takes a full statename as the selected item
		
	Sample usage: [state_select: -fieldname='your_state', -state='fl']
		
\*====================================================================*/

define_tag: 'state_select', 
			-op='fieldname', 
			-op='state', 
			-op='statename';

	local:'statelist'=
		(array:	'Non US'='Non US',
				'al'='Alabama',
				'ak'='Alaska',
				'az'='Arizona',
				'ar'='Arkansas',
				'ca'='California',
				'co'='Colorado',
				'ct'='Connecticut',
				'de'='Delaware',
				'dc'='District Of Columbia',
				'fl'='Florida',
				'ga'='Georgia',
				'hi'='Hawaii',
				'id'='Idaho',
				'il'='Illinois',
				'in'='Indiana',
				'ia'='Iowa',
				'ks'='Kansas',
				'ky'='Kentucky',
				'la'='Louisiana',
				'me'='Maine',
				'md'='Maryland',
				'ma'='Massachusetts',
				'mi'='Michigan',
				'mn'='Minnesota',
				'ms'='Mississippi',
				'mo'='Missouri',
				'mt'='Montana',
				'ne'='Nebraska',
				'nv'='Nevada',
				'nh'='New Hampshire',
				'nj'='New Jersey',
				'nm'='New Mexico',
				'ny'='New York',
				'nc'='North Carolina',
				'nd'='North Dakota',
				'oh'='Ohio',
				'ok'='Oklahoma',
				'or'='Oregon',
				'pa'='Pennsylvania',
				'ri'='Rhode Island',
				'sc'='South Carolina',
				'sd'='South Dakota',
				'tn'='Tennessee',
				'tx'='Texas',
				'ut'='Utah',
				'vt'='Vermont',
				'va'='Virginia',
				'wa'='Washington',
				'wv'='West Virginia',
				'wi'='Wisconsin',
				'wy'='Wyoming');
				
	local:'html_output'='';
	
	local:'selected'='';
								
	if:!(local:'state')->size;
		local:'state'='';
	/if;
	
	if:!(local:'statename')->size;
		local:'statename'='';
	/if;
	
	if:!(local:'fieldname')->size;
		local:'fieldname'='state';
	/if;
	
	#html_output = '\r';
	
	return: #html_output;
	
/define_tag;

Related Tags

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft