__________________________________________________ _______________
Expand|Select|Wrap|Line Numbers
- var Name="<%=value%>";
- var oForm = parent.window.opener.document.mainForm;
- var oSelect = oForm.elements["users1"];
- var oOptions = oSelect.options;
- var bAdd = true;
- if (oOptions) {
- for (var i=0; i < oOptions.length; i++) {
- if (oOptions[i].value == Name) {
- bAdd = false;
- }
- }
- }
- if (bAdd) {
- var oOption = document.createElement("OPTION");
- oOption.setAttribute("value", Name);
- oOption.appendChild(document.createTextNode(Name));
- oSelect.appendChild(oOption);
- }
I tried using this code which I find in some other site, but this also didnt work
Expand|Select|Wrap|Line Numbers
- if (document.all) { // IE
- select.add(opt);
- }
- else {
- select.appendChild(opt);
- }