wuming
V2EX  ›  问与答

微信小程序中如果 form 中含有多对相同的 name,如何在提交的时候同时提交这多对值

  •  
  •   wuming · Jan 30, 2018 · 3976 views
    This topic created in 3216 days ago, the information mentioned may be changed or developed.
    如
    <form bindsubmit="formSubmit">
    <input type="text" name="xxx" value="1"/>
    <input type="text" name="xxx" value="2"/>
    </form>

    微信小程序 js 中不支持选择器,formSubmit 接收到的值 e.detail.value 也只有最后一个,在上面的 input 会动态添加和减少的情况下,如何在提交的时候同时上传多个相同 name 的值
    2 replies  •  2018-01-31 09:28:28 +08:00
    ss098
    ss098
    Jan 30, 2018 via Android
    1
    name="xxx[]"
    wuming
    wuming
    OP
    Jan 31, 2018
    2
    @ss098 有尝试过,但是还是一样的结果,forSubmit 的 e.detail.value 只有一对 name value
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1124 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 18:16 · PVG 02:16 · LAX 10:16 · JFK 13:16
    ♥ Do have faith in what you're doing.