前言:微信小程序中很多地方运用到了表单,很多时候我们需要把表单中的内容提取出来返回给后台,这里我随便写了一点注意点:1.所有的input textarea button全部包含在form表单元素里2.button 必须有formType=”submit” 这个属性3.form 必须有提交事件 即bindsubmit=”back_houtai”4.通过 name属性取值,name名称不可重复图示:wxml文件<!–pages/biji/biji.wxml–><view class=’index_seach’><form bindsubmit=”back_houtai”><view class=’input_w professional’><text class=’left’>总分</text><view class=’input left’><input placeholder=’请输入总分’ cursor-spacing=’20’ name=’total_score’></input></view></view><view class=’input_w professional’><text class=’left’>专业课分</text><view class=’input left’><input placeholder=’请输入初试专业课成绩’ cursor-spacing=’20’ name=’major_score’></input></view></view><view class=’input_w professional’><text class=’left’>入学年份</text><view class=’input left’><input placeholder=’请输入入学年份 格式:2018′ cursor-spacing=’20’ name=’enroll_date’></input></view></view><view class=’textarea_w’><text class=’left’>自我介绍</text><view class=’textarea left’><textarea placeholder=’请输入一段话来介绍一下自己,说不定会更加吸引学弟学妹哦~’ cursor-spacing=’20’ name=”self_intro”></textarea></view></view><button class=’subClass_btn2′ formType=”submit”>确定</button></form></view>wxss文件/* pages/biji/biji.wxss */page{font-size: 30rpx;}.left{ float: left}.right{float: right}.index_seach {width: 100%;margin-top: 20rpx;height: auto;margin-bottom: 30rpx;}/* 表单类通用 表单类通用 表单类通用*/.input_w {width: 100%;height: 90rpx;line-height: 90rpx;/* background: lightblue; */}.input_w text {display: block;width: 20%;text-align: center;/* background: red; */}.input_w .input {width: 75%;height: 70rpx;margin-top: 10rpx;border: 1px solid #ccc;box-sizing: border-box;}.input input {margin-top: 10rpx;margin-left: 10rpx;/* background: lightblue; */}.textarea_w {display: block;width: 100%;height: 180rpx;overflow: hidden;}.textarea_w text {display: block;width: 20%;text-align: center;line-height: 90rpx;}.textarea {width: 75%;height: 140rpx;margin-top: 10rpx;border: 1px solid #ccc;padding: 8rpx;/* background: lightblue; */overflow: hidden;}.textarea textarea {width: 100%;height: 130rpx;/* background: lightcoral; */}/* 表单类通用 表单类通用 表单类通用*/.subClass_btn2 {margin-top: 40rpx;width: 80%;height: 80rpx;line-height: 80rpx;font-size: 30rpx;color: #fff;bac
微信小程序之获取表单数据
未经允许不得转载:E企盈小程序开发-热线:4006-838-530 » 微信小程序之获取表单数据
相关推荐
数据恢复软件(二):用C++重写恢复B乐都县E企盈小程序MP位图文件的小程序
公众号再次改版高坪区E企盈小程序小程序又多了一个入口
微信小程序加载图片时,湘桥区E企盈小程序先拉长,再恢复正常
转:(很有用)有多个按钮,点击一个变色,点击另吴中区E企盈小程序一个变色,原来的恢复颜色的方法
第12课微信小程序Component构造器自道里区E企盈小程序定义组件:
导航中的南海区E企盈小程序小竖线总结
小程序:after实现德格县E企盈小程序1px纵向分割线
汉沽区E企盈小程序企业微信内测朋友圈和客户群功能:小程序C位出道!
小程序运行加载密山市E企盈小程序机制
小程通城县E企盈小程序序中间有字的分隔线
公众号和小程序可以同名了名称支持同主体复盘锦E企盈小程序用
微信小程序修改主潜江市E企盈小程序体信息
最新评论
独特万商直播系统,直播系统技术开发公司
万商直播系统开发公司
优秀的团队,万商直播管理系统
不错的小程序案例
优秀的团队,不错的服务!
讲的很好
主播长的帅气
好系统好服务