用form表单提交获取用户的填写信息。共七个字段。安卓机是正常获取到所有值。但是iphone就会随机丢失几个值!!!
测试机型:iphone7plus
<form bindsubmit=‘formsubmit’>
<view>
<span>姓名:</span>
<input placeholder=‘请输入您的姓名’ id=“name” name=“name” type=‘text’></input>
</view>
<view>
<span>手机号:</span>
<input placeholder=‘请输入您的手机号’ id=“tel” name=“tel” maxlength=‘11’></input>
</view>
<view>
<span>钓场名称:</span>
<input placeholder=‘请输入钓场名称’ id=“pondname” name=“pondname” type=‘text’></input>
</view>
<view>
<span>钓场地址:</span>
<input placeholder=‘请输入钓场地址’ id=“pondaddress” name=“pondaddress”></input>
</view>
<view>
<span>账号:</span>
<input placeholder=‘请设置您的登录账号’ id=“account” name=“account” type=‘text’></input>
</view>
<view>
<span>密码:</span>
<input placeholder=‘请设置登录密码’ id=“password” name=“password” type=‘password’></input>
</view>
<view>
<span>类型:</span>
<picker range=’{{list}}’ range-key=‘name’ bindchange=‘choose’>
<input placeholder=‘请选择’ disabled name=“role” value=’{{list[index].name}}’></input>
</picker>
</view>
<view class=‘other’ style=‘margin-top:15%;’>
<radio id=“gree” bindtap=‘gree’ checked=’{{gree}}’ color=’#409FF0’></radio>
<label for=‘gree’ bindtap=‘gree’>我同意</label>
<text bindtap=‘show’>《平台钓场入驻协议》</text>
</view>
<view class=‘other’>
<button form-type=‘submit’>提交申请</button>
</view>
</form>
请问是哪里的问题
今天在iphone xs max上遇到了同样的问题 。微信6.7.4 举例:
< form bindsubmit = "formSubmit" > < input name = "real_name" placeholder = "填写真实姓名" maxlength = '60' /> < input name = "id_card" placeholder = "填写证件号码" type = "idcard" maxlength = '18' /> < button formType = "submit" >下一步</ button > </ form > |
formSubmit: function (e) { const { value: { real_name, id_card } } = e.detail; console.log( "real_name" , real_name); console.log( "id_card" , id_card); } |
在输入姓名后 ,紧接着输入证件号码 。输出的日志里 real_name 有值 而id_card = “” 。然而下面是见证奇迹的时刻:点击一下证件号的input,弹出键盘; 然后再点击下一步 就。。。。。有值了 。莫名其妙被客户投诉 代码看的眼睛疼没看出问题来 。