I am working on a hybrid of a search box and a select
element. The problem I have is that every time I choose an option from the slide down bar I get a text in the search box. I want the text to be a placeholder inside of the box and not a normal text. I am not really sure how to do it, so any help will be appreciated!
test.html:
<div style="position:relative;width:200px;height:25px;border:0;padding:0;margin:0;">
<select style="position:absolute;top:0px;left:0px;width:200px; height:25px;line-height:20px;margin:0;padding:0;"
onchange="document.getElementById('displayValue').value=this.options[this.selectedIndex].text; document.getElementById('idValue').value=this.options[this.selectedIndex].value;">
<option value="ID">Select ID</option>
<option value="Name">Select Name</option>
<option value="Surname">Select Surname</option>
</select>
<input type="text" name="displayValue" id="displayValue"
placeholder="add/select a value" onfocus="this.select()"
style="position:absolute;top:0px;left:0px;width:183px;width:180px\9;#width:180px;height:23px; height:21px\9;#height:18px;border:1px solid #556;" >
<input name="idValue" id="idValue" type="hidden">
</div>