For components that can obtain user input, you need to use the component's attribute bindchange to synchronize the user's input content to AppService.
<input id="myInput" bindchange="bindChange" /> <checkbox id="myCheckbox" bindchange="bindChange" /> var inputContent = {} Page({ data: { inputContent: {} }, bindChange: function(e) { inputContent[e.currentTarget.id] = e.detail.value } })
bindChange is the change event of the input box. The bindchange provided by WeChat still has minor support issues. Currently, this event can only be triggered by losing focus.
Recommended learning: Small program development
The above is the detailed content of How to obtain user input in a mini program. For more information, please follow other related articles on the PHP Chinese website!