
Originally Posted by
djr33
This isn't php... it's javascript.
The trick here is making the php output the right javascript code. Depending on the complexity of your php, and how much of the html it generates, it could be easy or hard. Hopefully, it's not too hard.
Anyway, for the javascript code itself...
<select onChange="result.value=this.value">
<option value="1">One</option>
<option value="2">Two</option>
</select>
<input type="text" id="result">
Note: You might want to set an initial value in the textfield that matches the pre-selected option in the dropdown.
Bookmarks