输入字段的值属性是否可以与显示的文本不同? [关闭]

I have a form input field and want to display a medicine-name in the field, but when I submit the form, it needs to submit the medicine-id. How can I do that?

<tr>
    <td>Medicine Name </td>
    <td> : 
        <input type="text" name="medicine_ID" id="medicine_ID" value="<?php echo  $_GET['medicine_Name'];?>"/>
    </td>
</tr>

You could add the medicine-ID as an hidden input field and the medicine-Name as the visible input field. When you submit the form you can access both values and deal with them as you see fit.

 <tr>
     <td width="100">Medicine Name </td>
     <td width="327" colspan="2"> : 
         <input type="text" name="medicine_NAME" id="medicine_NAME"  value="<?php echo  $_GET['medicine_Name'];?>"  size="25" required/>
         <input type="hidden" name="medicine_ID" id="medicine_ID"  value="<?php echo  $_GET['medicine_Id'];?>" />
    </td>
</tr>