[web] Cross Between Select and Input Form

Started by
11 comments, last by Tradone 18 years ago
I searched &#106avascript combobox on "yahoo"
and got this on the 1st or 2nd match or so:
http://krolik.net/ComboBox.shtml
Exactly what I wanted.
Thanks guys :D

edit: what the hell? It doesn't work on opera.
if you can, can you tell me why this doesn't work on opera?
function BuildDCBox(BaseName, StartValue, Options, PixelWidth, Other, AdditionalStyle){	var DCOptions	if (!(PixelWidth)) PixelWidth = 200;	if (!(StartValue)) StartValue = "";	if ((typeof Options) == "string")  { DCOptions = Options.split(",") } else { DCOptions = Options }	var strBuild = "";	if (document.layers)		strBuild += "<table border=0><tr><td align=center>";	strBuild += "<input type='text' value='" + StartValue;	strBuild += "' name='" + BaseName + "' id='" + BaseName + "' "	if (!(document.layers))		strBuild += "style='width: " + (PixelWidth - 19) + "px; position: relative; " + AdditionalStyle + "' ";	strBuild += Other + " />"	if (document.layers)		strBuild += "</td></tr><tr><td align=center>- Or Select -</td></tr><tr><td align=center>";	else		strBuild += "<img border='0' height='1' width='23' />";	strBuild += "<select name='" + BaseName + "DcboBox' id='" + BaseName ;	strBuild += "DcboBox' "	if (!(document.layers))		strBuild += "style='width: " + PixelWidth + "px; position: absolute; visibility: hidden; " + AdditionalStyle + "' ";	strBuild += "readonly='true'  onchange='UpdateDCBoxGeneric(event);' >" ;	if ((DCOptions) && (DCOptions.length))	{		for (var cnt = 0; cnt < DCOptions.length; cnt++ )		{			strBuild += "<option>" + DCOptions[cnt] + "</option>";		}	}	strBuild += "</select>";	if (document.layers)		strBuild += "</td></tr></table>";	return (strBuild);}


[Edited by - Tradone on April 18, 2006 6:37:26 PM]
Advertisement
How, exactly, is it not working? Is Opera giving you any errors, or is the thing just not being created?
well, krolik's ComboBox fools the user by putting up a layer of input type=text just above a select form.

seems like opera doesn't support layers.

This topic is closed to new replies.

Advertisement