<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
		<id>https://www.bxpsoftware.com/wixi/index.php?action=history&amp;feed=atom&amp;title=JavaScript_-_Select_option_manipulation</id>
		<title>JavaScript - Select option manipulation - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://www.bxpsoftware.com/wixi/index.php?action=history&amp;feed=atom&amp;title=JavaScript_-_Select_option_manipulation"/>
		<link rel="alternate" type="text/html" href="https://www.bxpsoftware.com/wixi/index.php?title=JavaScript_-_Select_option_manipulation&amp;action=history"/>
		<updated>2026-05-24T10:45:23Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.28.2</generator>

	<entry>
		<id>https://www.bxpsoftware.com/wixi/index.php?title=JavaScript_-_Select_option_manipulation&amp;diff=2235&amp;oldid=prev</id>
		<title>Philip Lacey at 19:26, 9 November 2014</title>
		<link rel="alternate" type="text/html" href="https://www.bxpsoftware.com/wixi/index.php?title=JavaScript_-_Select_option_manipulation&amp;diff=2235&amp;oldid=prev"/>
				<updated>2014-11-09T19:26:13Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en-GB'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 19:26, 9 November 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l148&quot; &gt;Line 148:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 148:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Module Specific:Form Management]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Topic:JavaScript]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Philip Lacey</name></author>	</entry>

	<entry>
		<id>https://www.bxpsoftware.com/wixi/index.php?title=JavaScript_-_Select_option_manipulation&amp;diff=1929&amp;oldid=prev</id>
		<title>Philip Lacey: Philip Lacey moved page Select option manipulation to JavaScript - Select option manipulation without leaving a redirect</title>
		<link rel="alternate" type="text/html" href="https://www.bxpsoftware.com/wixi/index.php?title=JavaScript_-_Select_option_manipulation&amp;diff=1929&amp;oldid=prev"/>
				<updated>2014-09-09T20:21:20Z</updated>
		
		<summary type="html">&lt;p&gt;Philip Lacey moved page &lt;a href=&quot;/wixi/index.php?title=Select_option_manipulation&amp;amp;action=view&quot; class=&quot;new&quot; title=&quot;Select option manipulation (page does not exist)&quot; data-bs-title=&quot;Select option manipulation&quot; data-bs-is-contentpage=&quot;1&quot;&gt;Select option manipulation&lt;/a&gt; to &lt;a href=&quot;/wixi/index.php/JavaScript_-_Select_option_manipulation&quot; title=&quot;JavaScript - Select option manipulation&quot; data-bs-title=&quot;JavaScript - Select option manipulation&quot; data-bs-is-contentpage=&quot;1&quot;&gt;JavaScript - Select option manipulation&lt;/a&gt; without leaving a redirect&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style='vertical-align: top;' lang='en-GB'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 20:21, 9 September 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;' lang='en-GB'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Philip Lacey</name></author>	</entry>

	<entry>
		<id>https://www.bxpsoftware.com/wixi/index.php?title=JavaScript_-_Select_option_manipulation&amp;diff=1928&amp;oldid=prev</id>
		<title>Philip Lacey at 20:01, 9 September 2014</title>
		<link rel="alternate" type="text/html" href="https://www.bxpsoftware.com/wixi/index.php?title=JavaScript_-_Select_option_manipulation&amp;diff=1928&amp;oldid=prev"/>
				<updated>2014-09-09T20:01:12Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en-GB'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 20:01, 9 September 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot; &gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Playing with these types requires good JavaScript skills.&amp;#160; All too often you see in Google searches dependance on JQuery or equivalent.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Playing with these types requires good JavaScript skills.&amp;#160; All too often you see in Google searches &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;coders showing &lt;/ins&gt;dependance on JQuery or equivalent.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here is a cross broswer compatible suite of functions which allow manipulation of &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;a &lt;/del&gt;select &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;box&lt;/del&gt;.&amp;#160; Built into the example is a suite of testing functions to demonstrate the usage of the functions.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here is a cross broswer compatible suite of functions which allow manipulation of select &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;options&lt;/ins&gt;.&amp;#160; Built into the example is a suite of testing functions to demonstrate the usage of the functions.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The functions here are based in part upon the examples laid out from mredkj.com ( http://www.mredkj.com/tutorials/tutorial005.html )&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== The JavaScript ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== The JavaScript ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Philip Lacey</name></author>	</entry>

	<entry>
		<id>https://www.bxpsoftware.com/wixi/index.php?title=JavaScript_-_Select_option_manipulation&amp;diff=1927&amp;oldid=prev</id>
		<title>Philip Lacey: Created page with &quot;There are a number of scenarios when playing with BeX where you will want to insert or remove items from drop down lists, i.e. manipulation of select types.   Playing with the...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.bxpsoftware.com/wixi/index.php?title=JavaScript_-_Select_option_manipulation&amp;diff=1927&amp;oldid=prev"/>
				<updated>2014-09-09T19:58:03Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;There are a number of scenarios when playing with BeX where you will want to insert or remove items from drop down lists, i.e. manipulation of select types.   Playing with the...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;There are a number of scenarios when playing with bxp where you will want to insert or remove items from drop down lists, i.e. manipulation of select types.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Playing with these types requires good JavaScript skills.  All too often you see in Google searches dependance on JQuery or equivalent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a cross broswer compatible suite of functions which allow manipulation of a select box.  Built into the example is a suite of testing functions to demonstrate the usage of the functions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The JavaScript ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script language=&amp;quot;JavaScript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
//Testing variables&lt;br /&gt;
var count1 = 0;&lt;br /&gt;
var count2 = 0;&lt;br /&gt;
&lt;br /&gt;
//#####################################################&lt;br /&gt;
// For prepending a new option into a select.&lt;br /&gt;
//#####################################################&lt;br /&gt;
function fn_Select_InsertBefore ( strSelect, strText, strValue, intPosition ) {&lt;br /&gt;
&lt;br /&gt;
	//If the object exists&lt;br /&gt;
	if (document.getElementById(strSelect)) {&lt;br /&gt;
&lt;br /&gt;
		//Get the object&lt;br /&gt;
		var objSelect = document.getElementById(strSelect);&lt;br /&gt;
		&lt;br /&gt;
		//Create the new option to add&lt;br /&gt;
		var objOption = document.createElement('option');&lt;br /&gt;
		objOption.text = strText;&lt;br /&gt;
		objOption.value = strValue;&lt;br /&gt;
		&lt;br /&gt;
		//If intPosition = null the item goes at the end&lt;br /&gt;
		if (intPosition == null) {&lt;br /&gt;
			try {&lt;br /&gt;
				// standards compliant; doesn't work in IE&lt;br /&gt;
				objSelect.add(objOption, null); &lt;br /&gt;
			}&lt;br /&gt;
			catch(ex) {&lt;br /&gt;
				// IE only&lt;br /&gt;
				objSelect.add(objOption); &lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		else {&lt;br /&gt;
			//Get the reference object of the item in the select to prepend to&lt;br /&gt;
			var objOption_Old = objSelect.options[intPosition];&lt;br /&gt;
			&lt;br /&gt;
			//Now, try the prepend&lt;br /&gt;
			try {&lt;br /&gt;
				// standards compliant; but doesn't work in IE&lt;br /&gt;
				objSelect.add(objOption, objOption_Old); &lt;br /&gt;
			}&lt;br /&gt;
			catch(ex) {&lt;br /&gt;
				// IE only&lt;br /&gt;
				objSelect.add(objOption, objSelect.selectedIndex); &lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
//#####################################################&lt;br /&gt;
// For removing items from a select&lt;br /&gt;
//#####################################################&lt;br /&gt;
function fn_Select_RemovePosition ( strName, intPosition ) {&lt;br /&gt;
&lt;br /&gt;
	//If the object exists&lt;br /&gt;
	if (document.getElementById ( strName )) {&lt;br /&gt;
&lt;br /&gt;
	//Get the ojbect&lt;br /&gt;
		var objSelect = document.getElementById ( strName );&lt;br /&gt;
&lt;br /&gt;
		//If null then we're working with the last item&lt;br /&gt;
		if (intPosition == null ) {&lt;br /&gt;
		&lt;br /&gt;
			//If there's something to remove&lt;br /&gt;
			if (objSelect.length &amp;gt; 0 ){&lt;br /&gt;
				objSelect.remove(objSelect.length - 1);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		else {&lt;br /&gt;
			if (objSelect.length &amp;gt;= intPosition ){&lt;br /&gt;
				objSelect.remove(intPosition);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
//#####################################################&lt;br /&gt;
// Current Select position&lt;br /&gt;
//#####################################################&lt;br /&gt;
function fn_Select_CurrentlySelected ( strName ) {&lt;br /&gt;
	var varReturn = null;&lt;br /&gt;
	if (document.getElementById ( strName )) {&lt;br /&gt;
		var objSelect = document.getElementById ( strName );&lt;br /&gt;
		varReturn = objSelect.selectedIndex; &lt;br /&gt;
	}&lt;br /&gt;
	return varReturn;&lt;br /&gt;
}&lt;br /&gt;
//#####################################################&lt;br /&gt;
// First items&lt;br /&gt;
//#####################################################&lt;br /&gt;
function fn_Select_InsertStart( strSelect, strText, strValue ){ fn_Select_InsertBefore ( strSelect, strText, strValue, 0 ) ; }&lt;br /&gt;
function fn_Select_RemoveStart( strSelect ){ fn_Select_RemovePosition ( strSelect, 0 ) ; }&lt;br /&gt;
//#####################################################&lt;br /&gt;
// Last items&lt;br /&gt;
//#####################################################&lt;br /&gt;
function fn_Select_InsertEnd( strSelect, strText, strValue ){ fn_Select_InsertBefore ( strSelect, strText, strValue, null ) ; }&lt;br /&gt;
function fn_Select_RemoveEnd( strSelect ){ fn_Select_RemovePosition ( strSelect, null ) ; }&lt;br /&gt;
//#####################################################&lt;br /&gt;
// Selected items&lt;br /&gt;
//#####################################################&lt;br /&gt;
function fn_Select_InsertSelected( strSelect, strText, strValue ){ fn_Select_InsertBefore ( strSelect, strText, strValue, fn_Select_CurrentlySelected ( strSelect ) ) ; }&lt;br /&gt;
function fn_Select_RemoveSelected( strSelect ){ fn_Select_RemovePosition ( strSelect, fn_Select_CurrentlySelected ( strSelect ) ) ; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The HTML ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form&amp;gt;&lt;br /&gt;
	&amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;&amp;amp;raquo;&amp;quot; onclick=&amp;quot;count1++; fn_Select_InsertStart ( 'selectX', count1, count1);&amp;quot; /&amp;gt;&lt;br /&gt;
	Insert First&amp;lt;br /&amp;gt;&lt;br /&gt;
	&amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;&amp;amp;raquo;&amp;quot; onclick=&amp;quot;fn_Select_RemoveStart ( 'selectX' );&amp;quot; /&amp;gt;&lt;br /&gt;
	Remove First&amp;lt;br /&amp;gt;&lt;br /&gt;
	&amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;&amp;amp;raquo;&amp;quot; onclick=&amp;quot;count1++; fn_Select_InsertSelected ( 'selectX', count1, count1);&amp;quot; /&amp;gt;&lt;br /&gt;
	Insert Before Selected&amp;lt;br /&amp;gt;&lt;br /&gt;
	&amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;&amp;amp;raquo;&amp;quot; onclick=&amp;quot;fn_Select_RemoveSelected( 'selectX' );&amp;quot; /&amp;gt;&lt;br /&gt;
	Remove Selected&amp;lt;br /&amp;gt;&lt;br /&gt;
	&amp;lt;select id=&amp;quot;selectX&amp;quot; size=&amp;quot;10&amp;quot; multiple=&amp;quot;multiple&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;option value=&amp;quot;original1&amp;quot; selected=&amp;quot;selected&amp;quot;&amp;gt;Orig1&amp;lt;/option&amp;gt;&lt;br /&gt;
		&amp;lt;option value=&amp;quot;original2&amp;quot;&amp;gt;Orig2&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;/select&amp;gt;&lt;br /&gt;
	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;&amp;amp;raquo;&amp;quot; onclick=&amp;quot;count2++; fn_Select_InsertEnd ( 'selectX', count2, count2);&amp;quot; /&amp;gt;&lt;br /&gt;
	Insert last&amp;lt;br /&amp;gt;&lt;br /&gt;
	&amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;&amp;amp;raquo;&amp;quot; onclick=&amp;quot;fn_Select_RemoveEnd( 'selectX' );&amp;quot; /&amp;gt;&lt;br /&gt;
	Remove Last&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Philip Lacey</name></author>	</entry>

	</feed>