Detailed description and simple examples of input labels in WeChat applets

Source: Internet
Author: User

Detailed description of the input tag in the applet and simple example, the input tag of the Applet

Detailed description of input tags in applets and simple examples

When using the input tag, we can use it in a small program. However, some common attributes cannot be used as expected:
I will use the most common examples:

One by one:

First, I defined his id, which is the most commonly used one, so I configured an id. After all, I did not operate on him. Why is it set to an input box? Second, set his style. Third, set his input category. The above is very simple. Fourth. Use the regular expression l. The input is limited to numbers only. This may be a bit hard to understand. This is a listener for his keyup event and will not be ignored for a list that is not a pure number. Note that it is for the whole, not for filtering by rows. Fifth, restrict his input to a maximum of 6 digits and listen to the sixth input event. This is exclusive. The seventh part of his event will be given below, setting his 'prompt s' when the input box is blank ';

Bindinput event:

Bind, as the name implies, is binding and binding input

The event is as follows:

Tapevent: function (e) {// if (e.tar get. id = "increase") {this. data. tickets ++; this. setData (this. data);} else {this. data. tickets --; this. setData (this. data);} // modify the total amount here },

This is an excerpt, so do not be curious about how to run this section. Tapevent is defined as a function. The operation is similar to that of Android. The page is refreshed.

Thank you for reading this article. I hope it will help you. Thank you for your support for this site!

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.