且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将选定的值转换为字符串?

更新时间:2023-10-14 14:01:40

我建​​议使用javascript / jquery使用所选事件上的选定值更新HTML中的隐藏字段,然后在服务器端使用它。

在javascript中你可以像这样使用

I would suggest to use javascript/jquery to update a hidden field in your HTML with the selected value on selected event then use it in your server side.
In javascript you can use like this
for (var i = 0; i  < document.getElementById("Manufacturer").options.length; i++) {
       if(select.options[i].selected ) {