如何向数据库发送隐藏信息[关闭]

so I have a Dropbox and I have 3 selections.

car
boat
plane

The value of each one is an image which sends to the database, and reads correctly, by displaying the image of their choice on my page. However, I would like to insert into the database the name of each one too, this will also display under the image. I have a separate column on the table for the hidden info to be input, but am unsure of how to do this that will correspond with the choice they made. Is it possible to do such a thing?

Yes You can pass the name and the image.

I believe you have select input field like this:

<select id="mySelect" onchange="myFunction()">
<option value="image-url" >Car</option>
<option value="image-url" >Boat</option>
<option value="image-url" >Plane</option>
</select>

Now, You can have :

<input type="hidden" id="selectoption" name="selectoption" value="" />

<script>
function myFunction() {
    var x = document.getElementById("mySelect").text;
    document.getElementById("selectoption").value = x;
}
</script>

This way you have an input hidden field with selected value. Now simply use the id and add the name to the database