V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
wuming
V2EX  ›  问与答

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

  •  
  •   wuming · Jan 30, 2018 · 3535 views
    This topic created in 3021 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
        1
    ss098  
       Jan 30, 2018 via Android
    name="xxx[]"
    wuming
        2
    wuming  
    OP
       Jan 31, 2018
    @ss098 有尝试过,但是还是一样的结果,forSubmit 的 e.detail.value 只有一对 name value
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1360 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 17:23 · PVG 01:23 · LAX 10:23 · JFK 13:23
    ♥ Do have faith in what you're doing.