combobox-textselect
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<style type="text/css">
.stext,
.sbox
{
margin-left: 0;
position: absolute;
border: 1px solid black;
}
.stext
{
width: 200px;
z-index: 100;
border-right: 0px solid black;
}
.sbox
{
width: 218px;
}
</style>
<!--[if lt IE 7]>
<style type="text/css">
.sbox
{
width: 220px;
}
</style>
<![endif]-->
<script type="text/javascript">
function stext(selectid, textid)
{
var select = document.getElementById(selectid);
var selectvalue = select.value;
var text = document.getElementById(textid);
text.value = selectvalue;
}
</script>
<!--[if ie]>
<script type="text/javascript">
function stext(selectid, textid)
{
var select = document.getElementById(selectid);
var selectvalue = select.options[select.selectedIndex].value;
var text = document.getElementById(textid);
text.value = selectvalue;
}
</script>
<![endif]-->
<noscript>Voor deze functie is JavaScript nodig.</noscript>
<input type="text" id="text" class="stext">
<select onchange="stext('select', 'text')" id="select" class="sbox">
<option value="Test">Test</option>
<option value="Nog een Test">Nog een test</option>
</select>
.stext,
.sbox
{
margin-left: 0;
position: absolute;
border: 1px solid black;
}
.stext
{
width: 200px;
z-index: 100;
border-right: 0px solid black;
}
.sbox
{
width: 218px;
}
</style>
<!--[if lt IE 7]>
<style type="text/css">
.sbox
{
width: 220px;
}
</style>
<![endif]-->
<script type="text/javascript">
function stext(selectid, textid)
{
var select = document.getElementById(selectid);
var selectvalue = select.value;
var text = document.getElementById(textid);
text.value = selectvalue;
}
</script>
<!--[if ie]>
<script type="text/javascript">
function stext(selectid, textid)
{
var select = document.getElementById(selectid);
var selectvalue = select.options[select.selectedIndex].value;
var text = document.getElementById(textid);
text.value = selectvalue;
}
</script>
<![endif]-->
<noscript>Voor deze functie is JavaScript nodig.</noscript>
<input type="text" id="text" class="stext">
<select onchange="stext('select', 'text')" id="select" class="sbox">
<option value="Test">Test</option>
<option value="Nog een Test">Nog een test</option>
</select>