


WeChat applet uses checkbox to display multiple selection box function [source code attached]
This article mainly introduces the function of using checkbox to display multiple selection boxes in WeChat applet, involving related event binding and element traversal operation techniques, and comes with source code for readers to download and refer to. Friends in need can refer to it
The example in this article describes the WeChat applet's use of checkbox to display multiple selection boxes. Share it with everyone for your reference, the details are as follows:
1. Effect display
##2. Key code
① index.wxml<checkbox-group bindchange="checkboxgroupBindchange"> <checkbox value="checkbox1">checkbox1</checkbox> <checkbox value="checkbox2">checkbox2</checkbox> <checkbox value="checkbox3">checkbox3</checkbox> </checkbox-group> <view>提示:{{text}}</view>② index.js
Page({ data:{ // text:"这是一个页面" text:'' }, checkboxgroupBindchange:function(e){ var temp1=e.detail.value var temp2='' console.log(temp1) if(temp1.length!=0){ for(var i=0,len=temp1.length;i<len;i++){ temp2=temp2+temp1[i]+',' } this.setData({ text:'您选择了:'+temp2 }) }else{ this.setData({ text:'' }) } } })
3. Source code
For detailed usage instructions of the checkbox component, please refer to the official website:https://mp.weixin.qq.com/debug/wxadoc/dev/component/checkbox.html
WeChat applet uses radio to display single option function [source code attached]
The above is the detailed content of WeChat applet uses checkbox to display multiple selection box function [source code attached]. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Atom editor mac version download
The most popular open source editor
