search
HomeWeChat AppletMini Program DevelopmentWeChat Mini Program Example: Code Implementation for Form Submission

The content of this article is about the WeChat applet example: the code implementation of form submission, which has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

<view class=&#39;container&#39;>
  <form bindsubmit=&#39;denglu&#39;>
    <view class=&#39;list&#39;>
      <view class=&#39;left&#39;>
        <label>手机号:</label>
        <input type=&#39;number&#39; name="tel" bindinput=&#39;shj&#39; maxlength=&#39;11&#39; placeholder=&#39;请输入手机号&#39;></input>
      </view>
      <view class=&#39;right&#39;></view>
    </view>
    <view class=&#39;list border&#39;>
      <view class=&#39;left&#39;>
        <label>验证码:</label>
        <input type=&#39;number&#39; name="code" placeholder=&#39;请输入验证码&#39;></input>
      </view>
      <view class=&#39;right&#39;>
        <button class=&#39;send&#39; wx:if="{{isShow}}" catchtap=&#39;send&#39;>发送验证码</button>
        <button class=&#39;send&#39; disabled=&#39;{{true}}&#39; wx:else>{{countdown}}秒后重新发送</button>
      </view>
    </view>
    <button form-type=&#39;submit&#39; class=&#39;btn&#39;>登录</button>
  </form>
</view>
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) {
    
  },

})

Note: Form submission is key-value matching based on the name attribute of the input

Related recommendations:

App() function in WeChat applet Detailed usage explanation

WeChat applet example: How to get the user’s openid (with code)

The above is the detailed content of WeChat Mini Program Example: Code Implementation for Form Submission. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Clair Obscur: Expedition 33 - How To Get Perfect Chroma Catalysts
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft