How to post two values in an option field?

前端 未结 6 2146
野性不改
野性不改 2020-12-01 22:38

I\'d like to post two values in one drop down option and I\'m not sure about the best way to approach it.

The drop down list pulls data in from an external service.

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 23:33

    The only way to do this is to include both pieces of information in the value for the single option. Just use code like the following, and then when you get the value back, split the string at the first underscore to separate out the values.

    
    

    Also, you could just leave the ID alone in your form, and then look up the id again when the user submits the form.

提交回复
热议问题