Link to home
Start Free TrialLog in
Avatar of vbguest123
vbguest123

asked on

List box Options

is there any simple way to create
option for listbox or combobox ?
it take much time to write options and its corresponding values
beter if provide any software.
Thanks
Avatar of vosk
vosk

Maybe that will help you. It's only a simple "codemaker":
<html>
<head>
<script language="JavaScript">
var b = 0, a, c, sn;
function A()
{
a = prompt("enter the nº of options");
sn = prompt("Enter the select name");
document.all.codi.innerText = "<select name=\"" + sn + "\">";
document.all.codi.insertAdjacentHTML("BeforeEnd","<br>&nbsp;");
c = window.setInterval("Create()",50);
}
function Create()
{
var val, writ;
b++;
if (b > a)
     {window.clearInterval(c)
      document.all.codi.innerText += "</select>";
     };
else
     {val = prompt("Enter the value for " + b + " option:");
      writ = prompt("Enter the external words for the " + b + " option:");
      document.all.codi.innerText += "<option value=\"" + b + "\">" + writ;
      document.all.codi.insertAdjacentHTML("BeforeEnd","<br>&nbsp;");
     };

}
</script>
<body onLoad="A();">
<div id="codi">
</div>
</body>
</html>
That creates the html code of a select tag. Then only copy/paste to the page. You can modify, implement, etc depending of what you need.
jbosch(vosk)
ASKER CERTIFIED SOLUTION
Avatar of Emad Gawai
Emad Gawai
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<%
dropdown = "a,b,c"
%>
<Select Name="DropDown">
<%
list = Split(dropdown, ",")
For i = 0 to UBound(list)
%>
<option value="<%=list(i)%>"><%=list(i)%>
<%Next%>
</Select>

try this and see whether it suits you