java - 下面代码,jQuery获取select的值总是不正确
高洛峰
高洛峰 2017-04-18 10:16:23
0
5
626

当选择了 司机之后,后台收到的值还是0,无论怎么变化都是0

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(5)
刘奇

Just $('#type').val()just

大家讲道理

Console the value before uploading to the background to see if there is any change.

伊谢尔伦

What you mean is to use the value of the option you selected, and the first one will be selected by default. Have you changed the selected options?
You can get it directly

$('#type').val();
黄舟

Thanks for the invitation
$('#type').val()

左手右手慢动作

I typed it exactly according to your code, and the local test did not show the bug in the question

It is recommended that the subject check whether other operations have changed the value of type.

F12 Open browser debugging, check whether the parameter type in the request sent is correct, and locate the bug in the front and backend

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template