-1

Hey guys I have a question. I am trying to put what I select from a drop down box into a input field and I am not sure how to do it.

Here is my code:

 <body>
<tr valign="top"> 
    <select id="dropdown">
        <option value="None">None</option>
        <option value="manufactor">Manufactor *Pending</option>
        <option value="commercial">Commercial Series *Pending</option>
        <option value="part">Part</option>
        <option value="motor">Motor</option>
    </select>
    <table>
        <td>
            <label for="Make1">Make:</label><br />
            <input type="text" name="Make" id="Make1" value="" maxlength="20">
        </td>
        <td>
            <label for="Manufactor1">Manufactor:</label><br />
            <input type="text" name="Manufactor" id="Manufactor1" value="" maxlength="15">
        </td>
        <td>
            <label for="Commercial1">Commercial:</label><br />
            <input type="text" name="Commercial" id="Commercial1" value="" maxlength="15">
        </td>
        <td>
            <label for="Part1">Part:</label><br />
            <input type="text" name="Part" id="Part1" value="" maxlength="15">
        </td>
        <td>
            <label for="motor1">Motor:</label><br />
            <input type="text" name="Motor" id="motor1" value="" maxlength="30">
        </td>
        <td>
            <label for="Dropdown1">Search Term:</label><br /> <--- want this to show what i selected from dropdown at the top.
            <input type="text" name="Dropdown" id="Dropdown1" value="" maxlength="30">
        </td>
    </table> 
</tr>

So I am wanting at the bottom Dropdown1 to show what I picked from the Dropdown but I am unsure of how this is done.

Alex
  • 174
  • 1
  • 3
  • 14

1 Answers1

1

By using Jquery you can achieve your requirement.

By using Change function.

Here is the working fiddle for you. Fiddle

$('#dropdown').change(function(){
$('#Dropdown1').val($(this).find(":selected").text())
;
});

-Help

Help
  • 1,156
  • 7
  • 11