search

Home  >  Q&A  >  body text

java - 下面代码,jQuery获取select的值总是不正确

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

高洛峰高洛峰2812 days ago628

reply all(5)I'll reply

  • 怪我咯

    怪我咯2017-04-18 10:18:23

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

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-18 10:18:23

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

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-18 10:18:23

    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();

    reply
    0
  • 黄舟

    黄舟2017-04-18 10:18:23

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

    reply
    0
  • ringa_lee

    ringa_lee2017-04-18 10:18:23

    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

    reply
    0
  • Cancelreply