我想将文本输入切换到带有选项 - > MYSQL的下拉列表

I currently have a form that has text entries that input properly into a database.

ON the last entry I want to switch it from text input to a drop down list. Here is my current code:

    <div class="form-group">
    <label for="equipment">Equipment:</label>
    <input type="text" id="equipment" name="equipment" value="<?php echo isset($equipment) ? $equipment : ''; ?>" />
    <span class="validity"></span>
    </div>

This is the code I tried switching it to:

<script type="text/javascript">

function showfield(name){

if(name=='Other')document.getElementById('div1').innerHTML='Other: <input type="text" name="other" />';

else document.getElementById('div1').innerHTML='';

}

</script>



<select name="equipment" id="equipment" onchange="showfield(this.options[this.selectedIndex].value)">

<option value="53V" <?php echo (isset($equipment) && $equipment == '53V') ? 'selected="selected"' : ''; ?>">53v</option>
<option value="53R" <?php echo (isset($equipment) && $equipment == '53R') ? 'selected="selected"' : ''; ?>">53r</option>
<option value="53F" <?php echo (isset($equipment) && $equipment == '53F') ? 'selected="selected"' : ''; ?>">53f</option>
<option value="Other">Other</option>

</select>

<div id="div1"></div>

Am I close at all?

EDIT: I edited based on Raptord's advice

Now I'm getting:

Error 2031 No data supplied for parameters in prepared statement

ADDED:

CREATE TABLE `details` (
  `id` int(11) UNSIGNED NOT NULL,
  `contactname` varchar(255) DEFAULT NULL,
  `phonenumber` varchar(255) DEFAULT NULL,
  `equipment` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

EDIT (REVISED CODE):

<script type="text/javascript">

function showfield(name){

if(name=='Other')document.getElementById('div1').innerHTML='Other: <input type="text" name="other" />';

else document.getElementById('div1').innerHTML='';

}

</script>

<div class="form-group">
<label for="equipment"><sup>*</sup> Equipment:</label>

<select name="equipment" id="equipment" onchange="showfield(this.options[this.selectedIndex].value)">
<option value="53V" <?php echo (isset($equipment) && $equipment == '53V') ? 'selected="selected"' : ''; ?>">53V</option>
<option value="53R" <?php echo (isset($equipment) && $equipment == '53R') ? 'selected="selected"' : ''; ?>">53R</option> 
<option value="53F" <?php echo (isset($equipment) && $equipment == '53F') ? 'selected="selected"' : ''; ?>">53F</option>
 <option value="Other">Other</option> </select> <div id="div1"></div>
</div>

Your option tags should look something like this, rather than having 2 value attributes:

<option value="53V" <?php echo (isset($equipment) && $equipment == '53V') ? 'selected="selected"' : ''; ?>>53v</option>