Home  >  Article  >  WeChat Applet  >  How to use WeChat applet textarea

How to use WeChat applet textarea

不言
不言Original
2018-06-23 15:08:473024browse

This article mainly introduces the detailed explanation and simple usage of WeChat applet textarea. Here is the implementation example code, and the method to solve the problem that textarea has no bindchange event and cannot assign values ​​to variables during input. Friends who need it can For reference,

WeChat mini program textarea simple solution

There is no bindchange event for textarea in WeChat mini program, so variables cannot be assigned values ​​during input.

Although the bindblur event can be used, if you bind the bindblur event and click the button again, the button event will be executed first and then the bindblur event will be executed, so the input value cannot be obtained in the js file,

Solution: Combined with the from form, after inputting into the textarea text box, click the submit button. At this time, the textarea event will be executed first (get the input content of the text box), and then the data will be executed. Submit, so the problem is solved

wxml file code: