所属分类:php教程
12345678910111213141516171819202122 <view class=
"'container'"
>
<form bindsubmit=
"'denglu'"
>
<view class=
"'list'"
>
<view class=
"'left'"
>
<label>手机号:</label>
<input type=
"'number'"
name=
"tel"
bindinput=
"'shj'"
maxlength=
"'11'"
placeholder=
"'请输入手机号'"
>
</view>
<view class=
"'right'"
></view>
</view>
<view class=
"'list"
border&
#39;="">
<view class=
"'left'"
>
<label>验证码:</label>
<input type=
"'number'"
name=
"code"
placeholder=
"'请输入验证码'"
>
</view>
<view class=
"'right'"
>
<button class=
"'send'"
wx:
if
=
"{{isShow}}"
catchtap=
"'send'"
>发送验证码</button>
<button class=
"'send'"
disabled=
"'{{true}}'"
wx:
else
=
""
>{{countdown}}秒后重新发送</button>
</view>
</view>
<button form-type=
"'submit'"
class=
"'btn'"
>登录</button>
</form>
</view>
登录后复制
1234567891011121314151617181920212223242526 const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
isShow:
true
},
//登录
denglu:
function
(e){
let fromdate=e.detail.value;
wx.request({
data:fromdate,
success:
function
(res){}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad:
function
(options) {
},
})
登录后复制
注意: 表单提交是根据input的name属性进行键值配对的
相关推荐:
微信小程序中的App()函数的用法详解
微信小程序实例:如何获取用户的openid(附代码)
以上就是微信小程序实例:表单提交的代码实现的详细内容,更多请关注zzsucai.com其它相关文章!