Set the State Field / Online Join iPart

The previous blog entry touched on setting the country code via the online join to a fixed value (examples provided for Canada and US).

Twitter user @thejamesjones responded to suggest doing the same thing to the state field for state-based organizations.

This assumes that your default country code (via the appropriate RiSE setup page) is US, if it's another country use the earlier script to set the country code first.

Add this to the bottom of the page (Content_HTML iPart)

<script>
	jQuery(document).ready(function() {
		setTimeout(function(){ 
			jQuery("[id$='_SelectCountry'] option:not(:selected)").attr("disabled", true);
			jQuery("[id$='_SelectSubEntityCode']").val("IA");
			jQuery("[id$='_SelectSubEntityCode'] option:not(:selected)").attr("disabled", true);
		}, 250);
	});
</script>

The end result of this script should be a country code set to "United States", and a state code set to "Iowa", with neither field being updateable.


back
Categories
2459 Bridge Road
Oakville, ON
L6L 2G9
Canada
jake@k2andyou.com
support@k2andyou.zendesk.com
Office: (905) 901-3625
Mobile: (289) 795-3538