471,596 Members | 1,061 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,596 software developers and data experts.

select box without scrollbar


Is it possible to display the select box without scrollbar
in my program there is a need for that . The code attached below
contains 2 select box and four buttons and the button is used to
interchange the data's in the select box.
(provuide coding for no scrollbar in select box)

Thank You in advance

<htm>
<body>
<form name="listselection">
<center>
<br><br><br><br>

<TABLE BORDER=0>
<TR>
<TD>
<SELECT NAME="list1" id="list1" SIZE=20 style="width:100px;">
<OPTION VALUE="Finance">Finance</OPTION>
<OPTION VALUE="Marketing">Marketing</OPTION>
<OPTION VALUE="Sales & Rep">Sales & Rep</OPTION>
<OPTION VALUE="Shipping">Shipping</OPTION>
<OPTION VALUE="Revenue">Revenue</OPTION>
<OPTION VALUE="Transport">Transport</OPTION>
</SELECT>
</TD>

<TD VALIGN=MIDDLE ALIGN=CENTER>
<INPUT TYPE="button" NAME="right" VALUE=">"
ONCLICK="moverightsingle()"><BR><BR>
<INPUT TYPE="button" NAME="right" VALUE="All >>"
ONCLICK="moverightall()"><BR><BR>
<INPUT TYPE="button" NAME="left" VALUE="<"
ONCLICK="moveleftsingle()"><BR><BR>
<INPUT TYPE="button" NAME="left" VALUE="All <<"
ONCLICK="moveleftall()">
</TD>
<TD>
<SELECT NAME="list2" id="list2" MULTIPLE SIZE=20 style="width:100px;">
<OPTION VALUE="One">One</OPTION>
<OPTION VALUE="Two">Two</OPTION>
<OPTION VALUE="Three">Three</OPTION>
<OPTION VALUE="Four">Four</OPTION>
<OPTION VALUE="Five">Five</OPTION>
<OPTION VALUE="Six">Six</OPTION>

</SELECT>
</TD>

</TR>

</TABLE>
</center>
<form>
</body>
</html>

<script>

function moverightsingle()
{

var x=document.getElementById("list1")
var y=x.options[x.selectedIndex].text
var index=x.selectedIndex;

myOption=new Option();
myOption.text=y;

insertIndex=document.listselection.list2.options.l ength;
document.listselection.list2.options[insertIndex]=myOption;
document.listselection.list1.options[index]=null;
}

function moveleftsingle()
{

var xx=document.getElementById("list2");
var yy=xx.options[xx.selectedIndex].text
var index=xx.selectedIndex

myOption=new Option();
myOption.text=yy;

insertIndex=document.listselection.list1.options.l ength;
document.listselection.list1.options[insertIndex]=myOption;
document.listselection.list2.options[index]=null;

}

function moverightall()
{
var listlength=document.getElementById("list1").length ;

for(var i=0;i<listlength;i++)
{

var x=document.getElementById("list1");
var data=x.options[i].text

myOption=new Option();
myOption.text=data;

insertIndex=document.listselection.list2.options.l ength;
document.listselection.list2.options[insertIndex]=myOption;

}

for(var i=0;i<listlength;i++)
{

var x=document.getElementById("list1")
var y=x.options[0].text
var index=0;
document.listselection.list1.options[index]=null;

}

}
function moveleftall()
{
var listlength=document.getElementById("list2").length ;

for(var i=0;i<listlength;i++)
{

var x=document.getElementById("list2");
var data=x.options[i].text

myOption=new Option();
myOption.text=data;

insertIndex=document.listselection.list1.options.l ength;
document.listselection.list1.options[insertIndex]=myOption;

}

for(var i=0;i<listlength;i++)
{

var x=document.getElementById("list2")
var y=x.options[0].text
var index=0;
document.listselection.list2.options[index]=null;

}

}
</script>
*** Sent via Developersdex http://www.developersdex.com ***
Jan 20 '06 #1
6 8198
rajesh said the following on 1/20/2006 8:13 AM:
Is it possible to display the select box without scrollbar
in my program there is a need for that .
Absolutely.
<SELECT NAME="list1" id="list1" SIZE=20 style="width:100px;">


<select multiple size="20"...>

Voila! No scrollbars.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 20 '06 #2
"Randy Webb" <Hi************@aol.com> wrote in message
news:Pu******************************@comcast.com. ..
rajesh said the following on 1/20/2006 8:13 AM:
Is it possible to display the select box without scrollbar
in my program there is a need for that .


Absolutely.
<SELECT NAME="list1" id="list1" SIZE=20 style="width:100px;">


<select multiple size="20"...>

Voila! No scrollbars.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -

http://www.JavascriptToolbox.com/bestpractices/

He already had MULTIPLE on one of the selects and it doesn't have any
effect under Firefox (and likely other browsers).

No scrollbars under IE as long as "Size=" exceeds the number of options.

Also, the exxisiting logic doesn't support moving multiple items.
Jan 20 '06 #3
McKirahan said the following on 1/20/2006 10:23 AM:
"Randy Webb" <Hi************@aol.com> wrote in message
news:Pu******************************@comcast.com. ..
rajesh said the following on 1/20/2006 8:13 AM:
Is it possible to display the select box without scrollbar
in my program there is a need for that . Absolutely.
<SELECT NAME="list1" id="list1" SIZE=20 style="width:100px;">

<select multiple size="20"...>

Voila! No scrollbars.


He already had MULTIPLE on one of the selects and it doesn't have any
effect under Firefox (and likely other browsers).


There is no scrollbar in Firefox for the code I posted. There is a
placeholder for the scrollbars but no way of "scrolling".
No scrollbars under IE as long as "Size=" exceeds the number of options.
Tell Goober I said "Duh huh". Ever heard of John Boy and Billy?
Also, the exxisiting logic doesn't support moving multiple items.


That wasn't the question I answered.

And please fix your OE so that it quotes properly.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 20 '06 #4
"Randy Webb" <Hi************@aol.com> wrote in message
news:zP********************@comcast.com...
McKirahan said the following on 1/20/2006 10:23 AM:
"Randy Webb" <Hi************@aol.com> wrote in message
news:Pu******************************@comcast.com. ..
rajesh said the following on 1/20/2006 8:13 AM:
Is it possible to display the select box without scrollbar
in my program there is a need for that .
Absolutely.

<SELECT NAME="list1" id="list1" SIZE=20 style="width:100px;">
<select multiple size="20"...>

Voila! No scrollbars.

He already had MULTIPLE on one of the selects and it doesn't have any
effect under Firefox (and likely other browsers).


There is no scrollbar in Firefox for the code I posted. There is a
placeholder for the scrollbars but no way of "scrolling".


My interpretation of the OP was that he didn't want the placeholder.
No scrollbars under IE as long as "Size=" exceeds the number of options.


Tell Goober I said "Duh huh". Ever heard of John Boy and Billy?


IE doesn't show the placeholder;
Firefox does even if "size=" exceeds the number of options.
Also, the exxisiting logic doesn't support moving multiple items.


That wasn't the question I answered.


It wasn't directed at you.
And please fix your OE so that it quotes properly.
Please clarify.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -

http://www.JavascriptToolbox.com/bestpractices/
Jan 20 '06 #5
McKirahan said the following on 1/20/2006 11:45 AM:
"Randy Webb" <Hi************@aol.com> wrote in message
news:zP********************@comcast.com...
McKirahan said the following on 1/20/2006 10:23 AM:
"Randy Webb" <Hi************@aol.com> wrote in message
news:Pu******************************@comcast.com. ..
rajesh said the following on 1/20/2006 8:13 AM:
> Is it possible to display the select box without scrollbar
> in my program there is a need for that .
Absolutely.

> <SELECT NAME="list1" id="list1" SIZE=20 style="width:100px;">
<select multiple size="20"...>

Voila! No scrollbars.

He already had MULTIPLE on one of the selects and it doesn't have any
effect under Firefox (and likely other browsers).

There is no scrollbar in Firefox for the code I posted. There is a
placeholder for the scrollbars but no way of "scrolling".


My interpretation of the OP was that he didn't want the placeholder.


Difference in interpretation then. Fair enough.
No scrollbars under IE as long as "Size=" exceeds the number of options.

Tell Goober I said "Duh huh". Ever heard of John Boy and Billy?


IE doesn't show the placeholder;
Firefox does even if "size=" exceeds the number of options.


True.
Also, the exxisiting logic doesn't support moving multiple items.

That wasn't the question I answered.


It wasn't directed at you.


OK.
And please fix your OE so that it quotes properly.


Please clarify.


See whats below? That is my signature from the post you replied to. OE
does not snip signatures as it should. There is a fix somewhere (I dont
recall where) that fixes that problem. Signatures shouldn't be quoted in
Usenet unless it is the signature itself that is being discussed.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -

http://www.JavascriptToolbox.com/bestpractices/

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 20 '06 #6
"Randy Webb" <Hi************@aol.com> wrote in message
news:fo********************@comcast.com...

[snip]
And please fix your OE so that it quotes properly.
Please clarify.


[snip]
Signatures shouldn't be quoted in
Usenet unless it is the signature itself that is being discussed.


Got it. (Sometimes I get lazy.)
Jan 20 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by frodo | last post: by
3 posts views Thread by John Kraft | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.