第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

form提交的值為空?

沒有報錯,請求是成功的,后臺也沒有報錯,就是提交的表單數(shù)據(jù)都是空,數(shù)據(jù)庫有這一條數(shù)據(jù),但也是空值。為什么?

--------------------------

.js

--------------------------

formSubmit: function(e) {

if (e.detail.value.name.length == 0 || e.detail.value.houseId.length == 0) {

wx.showToast({

title: '姓名或房間號不能為空',

icon: 'loading',

duration: 1500

})

} else {

var that = this;

var url = that.data.addUrl;

var formData = e.detail.value;

console.log(formData)

wx.request({

url: url,

data: {

// id:e.target.value.id,

household:e.target.value

},

dataType: JSON,

method: 'POST',

header: {

'content-type': 'application/json' // 默認值

},

complete: function(res) {

console.log("success")

wx.redirectTo({

url: '/pages/info/info',

})

}

})

}

}

-----------------------------------------------------------------------

.wxml

-----------------------------------------------------------------------

<view class="container">

<form bindsubmit="formSubmit" bindreset="formReset">

<input type='text' name="id" class='id' value="{{id}}"></input>

<view class="row">

<text>姓名:</text>

<input type="text" name="name" placeholder="姓名" value="{{name}}" required/>

</view>

<view class="row">

<text>房間號</text>

<input type="text" name="houseId" placeholder="房間號" value="{{houseId}}" />

</view>

<view class="row">

<button type="primary" form-type="submit">提交</button>

<button type="primary" form-type="reset">清空</button>

</view>


</form>

</view>


正在回答

1 回答

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

form提交的值為空?

我要回答 關注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號