WeChat applet (16) form component details, Applet form

Source: Internet
Author: User

Applet (16) form component details, Applet form

The form component submits the values of all selected attributes in the form. Note that each component in the form must have the name attribute specified. Otherwise, the component cannot be submitted. The type in the button must be submit, the reset attribute corresponds to two form events respectively.

Main attributes:

Wxml

<Form bindsubmit = "listenFormSubmit" bindreser = "listenFormReser"> <checkbox-group name = "checkbox" bindchange = "listenerCheckbox"> <label style = "display: flex" wx: for-items = "{items }}"> <checkbox value =" {item. name }}"/>{{ item. value }}</label> </checkbox-group> <! -- The button formType attribute has two optional values: submit, and reset triggers the form submit, respectively, reser event --> <button formType = "submit" type = "primary"> submit </button> <button formType = "reset" type = "warn"> reset </button> </form>

Js

Page ({/*** initialization data */data: {items: [{name: 'java', value: 'android', checked: 'true'}, {name: 'object-C', value: 'ios '}, {name: 'jsx', value: 'reactnative '}, {name: 'js', value: 'cmd'}, {name: 'python', value: 'web'}]}, listenCheckboxChange: function () {console. log (e. detail. value) ;}, onLoad: function (options) {// parameters of page initialization options for page Jump }})

Related Articles:

Hello WeApp icon component
Window text Component switch component
Tabss component action-sheet
Application lifecycle button Component modal component
Page lifecycle checkbox component toast component
Modular Details form component details loading component
Data Binding input component navigator component
View component picker component audio component
Scroll-view component radio component video component
Swiper component slider component Image component

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.