hi to change the look and feel of select box in html
hi,
i got som peculiar requirement in my jsp page.i have my page like this.
<html>
<body>
<form name="test">
<select name="test">
<option value="one">USA</option>
<option value="two">India</option>
<option value="three">UAE</option>
</select>
</body>
</html>
this is one of the select box in my jsp page.
now i want to change the look and feel of select box..
1-dont want to show the scrollbar means the right side arrow which allows to see the total options in select box.
it should look like normal text box.
2-roveer apert from the existing values if there is no matching value user must be allowed to enter his own value in above select box..
how i can solve this problen..
regards,
sam
# 1 Re: hi to change the look and feel of select box in html
You are trying to use a select box for what it is not designed for, it is a SELECT box, select being the operative word.
To show more than one object you can use
<select name="test" SIZE=10>
This will show ten rows but will still have scrolling option if there are more than 10 options.
I think your best bet is to have some cool code below.
<INPUT TYPE=text NAME="find"><BR>
<select name="test">
<option value="one">USA</option>
<option value="two">India</option>
<option value="three">UAE</option>
</select>
You could add some code to filter through all the objects in the select on each keypress. When the object cant find something in the list that matches you could add it to the list so that the person can select it. If the item is found keep pointing to it in the select by highlighting that row.
You would actually be better to store all your information in a javascript array as well.
I use this myself in some of my applications, Im not going to give you the exact code as its quite long. I hope this helps.
Vanny at 2007-11-8 0:20:12 >

# 2 Re: hi to change the look and feel of select box in html
i couldn't get anything from your answer.
here u rtaking a text box and below the select box.if we keep like that it shows both thing in form.what i want is select box should look like text box.when user clicks on it it should become like select box with above values after select again it normal text box with selected value..
regards,
sam
# 3 Re: hi to change the look and feel of select box in html
You will need to look in DIVs and SPANs and lay one over the other (eg show one and hide one). You would also need to write some tricky javascript to port the options from one to the other. Basically you cant do what you want with just a normal select box, you are almost writing your own control.
Here are a few different examples online, maybe one of these can help you
http://javascript.internet.com/forms/pass-multiple-values.html
However I think this one is more appropriate
http://javascript.internet.com/messages/editable-menu.html
Vanny at 2007-11-8 0:22:17 >

# 4 Re: hi to change the look and feel of select box in html
Why not use divs, spans etc to position one over the other like you say, then use style tags to hide, make visible.. e.g
style="visibility: hidden"
style="visibility: visible"