Current File : //var/wcp4/mycath2o/public_html/file/private/templates.old/common/editor_select_option.html
<html>
<head><title>Add Option</title>
<style><%include editor_dialog.css%></style>
<SCRIPT LANGUAGE="JavaScript">
<!--

obj = {};

function done () {
/* ---------------------------------------------------------
 * Called when the OK buttun is pressed. Sets the window 
 * return value to an object containsing the user input
 * and closes the window.
 */
	var ret = false;
	if (text.value) {
		obj.children (0).innerText = text.value;
		ret = true;
	}
	obj.children (1).innerText = (opts[0].checked) ? 'Yes' : 'No';
	if (value.value) {
		obj.children (2).innerText = value.value;
		ret = true;
	}
	returnValue = ret;
	window.close ();
}

function get_args () {
/* ---------------------------------------------------------
 * Called onload to recieve the arguments passed in.
 */
	obj = window.dialogArguments;
	if (!obj) alert ("No object");
	if (!obj.children (0)) alert ("No children");
	if (obj.children (0).innerText) {
		text.value = obj.children (0).innerText;
	}
	if (obj.children (1).innerText != 'Yes') {
		opts[1].checked = true;
	}
	if (obj.children (2).innerText) {
		value.value = obj.children (2).innerText;
	}

}

//-->
</SCRIPT>
</head>
<body onload="get_args();">
<table border=0 cellpadding=3 align=center>
	<tr>
		<td>Option: </td><td><input type=text id=text size=30></td>
	</tr>
		<td>Value: </td><td><input type=text id=value size=30></td>
	</tr>
	<tr>
		<td>Selected: </td><td><input type=radio value=yes name=opts id=selected checked>Yes <Input type=radio name=opts id=not_selected>No</td>
	</tr>
</table>
<hr>
<div align=right>
	<button onclick="done()" class=button>OK</button> &nbsp;
	<button onclick="window.close();" class=button>Cancel</button>
</div>
</body>
</html>