Forum Moderators: open

Message Too Old, No Replies

Finish:Editable select

for DrDOC's welcome

         

waxbird

8:11 am on Feb 2, 2004 (gmt 0)

10+ Year Member



I find the way,Share for everyone.
======================================
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<select name="select"style="position:absolute;width:118px;clip:rect(0 120 22 100)">
<option>Waxbird</option>
<option>DrDOC</option>
</select>
<input type="text" style="position:absolute;width:100px;border-right:0">
</body>
</html>

DrDoc

4:28 pm on Feb 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That looks really good. However -- it will not control the select itself, nor will the select change as you type. Also, if you change the value in the select manually, it will not change the text, leading people to believe it's not working.

DylanW

5:18 pm on Feb 2, 2004 (gmt 0)

10+ Year Member



Very neat.

Fixed it so that it'll automatically update:

<form name="form">
<select name="select" onChange="document.form.text.value=document.form.select.options[document.form.select.selectedIndex].value" style="position:absolute;width:118px;clip:rect(0 120 22 100)">
<option value="Waxbird">Waxbird</option>
<option value="DrDoc">DrDOC</option>
</select>
<input type="text" name="text" onChange="document.form.select.selectedIndex=-1" style="position:absolute;width:100px;border-right:0">
</form>

DrDoc

5:45 pm on Feb 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



And if I start typing "dr..." it will jump to "DrDoc" in the select?

chrisj123

11:09 pm on Feb 4, 2004 (gmt 0)

10+ Year Member



Sorry if I've missed something but does anyone else find that the first selection they make from the drop down does not go in to the field?

I've tried this with both Firebird and IE and can't find what's wrong.

Other than that, thank you for this little snippet. I've just been pondering if it was possible to this and wouldn't have known where to start.

ChrisJ

Edit:
I've just realised that if I put some junk in the first option ie."Select below or type above" with the value set as "" it's actually a nice way of emptying the text field as well explaining how it works.