提交表单传值

Posted xiaoruaning

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了提交表单传值相关的知识,希望对你有一定的参考价值。

data: {
localImage: app.globalData.localImage,
com_mobile: null,//电话号码
com_password: null,//密码
},
 
/**
* 提交表单 注册
*/
submit: function (e) {
console.log(e)
let value = e.detail.value;
/**
* 判断每个input是否为空
*/
if (value.Phone_number == ‘‘) {
wx.showToast({
title: ‘手机号码不能为空‘,
icon: ‘none‘,
})
return false;
} else if (value.Verification_Code == ‘‘) {
wx.showToast({
title: ‘验证码不能为空‘,
icon: ‘none‘,
})
return false;
} else if (value.Verification_Code !=code) {
wx.showToast({
title: ‘验证码不正确‘,
icon: ‘none‘,
})
return false;
} else if (value.Password == ‘‘) {
wx.showToast({
title: ‘密码不能为空‘,
icon: ‘none‘,
})
return false;
} else if (value.Password2 == ‘‘) {
wx.showToast({
title: ‘重复密码不能为空‘,
icon: ‘none‘,
})
return false;
} else if (value.password2 != value.password1) {
wx.showToast({
title: ‘密码和重复密码不相同‘,
icon: ‘none‘,
})
return false;
}
let data = {
com_mobile: value.Phone_number,
com_password: utilMd5.hexMD5(value.Password),
}
console.log(JSON.stringify(data))
wx.navigateTo({
url: ‘../Perfect_information/Perfect_information?data=‘ + JSON.stringify(data)
})
},
 //新页面接收值
var last_page_data=null//全局
 
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
that = this;
last_page_data = JSON.parse(options.data)
console.log(last_page_data)
},

以上是关于提交表单传值的主要内容,如果未能解决你的问题,请参考以下文章

java web 的表单提交与传值

提交表单传值

使用form表单进行前后台传值

From表单中的传值有那几种方法?

页面传值和页面跳转

PHP 表单用post传值不了 跳转出现空白页。。