Manage Learn to apply best practices and optimize your operations.

Easily add content to your selectlist (drop down list)

If you want to add easy content to your selectlist (dropdown list) this is your tip.

If you want to add easy content to your selectlist (dropdown list) this is your tip. Simply use the code below. It simply transforms your selectlist into a field where you can add your value. After that it will transform back into a select list. "Long Live the Dom"

Add if(this.options[this.selectedIndex].text == 'Other...') selectOther(this); to the ONCHANGE event of the select list and make sure the select list has an Other... option. The script should do the rest.

function selectOther(list) {
	var input = document.createElement("INPUT");
	input.className = "select";
	input.type = "text";
	input.onblur = function() {
		var list = this.oldNode;
		list.options[list.options.length - 1] = new Option(this.value, "", true);
		list.options[list.options.length] = new Option("Other...");
		list.selectedIndex = list.options.length - 2;

		this.parentNode.replaceChild(list, this);
	};
	input.oldNode = list.parentNode.replaceChild(input, list);
}
This was last published in March 2002

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close