收藏
回答

form表单提交数据缺少值,不知怎么回事?

<form bindsubmit="jiGong">
    <view class="root">
        <view class="jigong">
            <view class="jigong_rq">日期:</view>
            <picker mode="date" name="riqi" value="{{time}}" bindchange="getTime">
                <view class="jigong_riqi">{{time?time:'请选择'}}</view>
            </picker>
        </view>
        <view class="jigong">
            <view class="jigong_rq">项目:</view>
            <input class="jigong_riqi" name="xiangmu" />
        </view>
        <view>
            <view class="jigong">
                <view class="jigong_rq">负责人:</view>
                <input class="jigong_riqi" placeholder="请输入负责人给的手机号" name="fuzeren" />
            </view>
        </view>
    </view>
    <view class="jigong_xinxi">
        <view class="jigong_xinxi_1">
            <view class="jigong_xinxi_text">地址:</view>
            <image class="jigong_xinxi_dizhi" src="/image/dz.png" wx:if="{{!dizhi}}" ></image>
            <view class="jigong_xinxi_dizhi1"  wx:else name="dizhi">{{dizhi}}</view>
        </view>
        <view class="jigong_xinxi_1">
            <view class="jigong_xinxi_text">工资:</view>
            <input class="jigong_xinxi_num" placeholder="请输入工资" type="number" name="gongzi" />
        </view>
        <view class="jigong_xinxi_2">
            <view class="jigong_xinxi_text_1">备注:</view>
            <textarea class="jigong_xinxi_beizhu" placeholder="请输入备注..." name="beizhu" />
        </view>
        <view class="jigong_xinxi_1">
            <view class="jigong_xinxi_text">款项:</view>
            <picker mode="selector" value='{{type}}' range="{{kuanxiang}}" bindchange="getKuanXiang" name="kuanxiang">
                <view class="jigong_xinxi_kuanxiang{{type.length>0?'kuanxiang':''}}"  >{{type?type:'请选择'}}</view>
            </picker>
        </view>
        <view class="jigong_xinxi_2">
            <view class="jigong_xinxi_text_1">照片:</view>
            <image class="jigong_xinxi_img" wx:if="{{!image}}" src="/image/tpj.png" mode="scaleToFill" bindtap="getImage" />
            <image class="jigong_xinxi_img1" wx:else="" src="{{image}}" mode="scaleToFill"  name="tupian" />
        </view>
        
        <button class="jigong_queren" form-type="submit">确认保存</button>
    </view>
</form>



调试器显示出来的值。

  1. currentTarget: {id""offsetLeft0offsetTop10dataset: {…}}
  2. detail:
  3. target: {id""dataset: {…}, offsetTop550offsetLeft14}
  4. value:
  5. beizhu""
  6. fuzeren""
  7. gongzi""
  8. kuanxiangnull
  9. riqi""
  10. xiangmu""


回答关注问题邀请回答
收藏

1 个回答

  • Hlxuan.
    Hlxuan.
    2023-01-03

    image不是表单组件。

    2023-01-03
    有用
    回复 1
    • 阿超
      阿超
      发表于小程序端
      2023-01-03

      意思是不能用view 和image组件。

      2023-01-03
      回复
登录 后发表内容