当前位置:网站首页>Applet password input box
Applet password input box
2022-06-25 19:33:00 【Bin daotianxia】
Applet password input box .
The initial state is input Can't click .

Click on input Eject keyboard later . After all the input boxes are entered, you can click Submit .

Specific code :
<view class="Toptitle"> Please set the payment password and keep it properly </view>
<form bindsubmit="formSubmit">
<view class='content'>
<block wx:for="{
{Length}}" wx:key="item">
<input class='iptbox' value="{
{Value.length>=index+1?Value[index]:''}}" disabled password='{
{ispassword}}' catchtap='Tap'></input>
</block>
</view>
<input name="password" password="{
{true}}" class='ipt' maxlength="{
{Length}}" focus="{
{isFocus}}" bindinput="Focus"></input>
<view>
<button class="btn-area" type='primary' disabled='{
{disabled}}' formType="primary"> next step </button>
</view>
</form>CSS It's very simple :
.Toptitle{
text-align: center;
margin: 60rpx auto 46rpx;
font-size: 26rpx;
}
.content{
width: 660rpx;
padding:0 45rpx;
display: flex;
justify-content: space-around;
align-items: center;
margin-top: 100rpx;
}
.iptbox{
width: 110rpx;
height: 96rpx;
border:1rpx solid #ddd;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}
.ipt{
width: 0;
height: 0;
}
.btn-area{
width: 80%;
margin-top: 60rpx;
}The key is JS. Focus popup IME , After losing focus, go to the next .
Page({
data: {
Length: 6, // Number of input fields
isFocus: true, // focusing
Value: "", // Input content
ispassword: true, // Whether the ciphertext is displayed true For the cipher , false In plain text .
disabled:true,
},
Focus(e) {
var that = this;
console.log(e.detail.value);
var inputValue = e.detail.value;
var ilen = inputValue.length;
if(ilen == 6){
that.setData({
disabled: false,
})
}else{
that.setData({
disabled: true,
})
}
that.setData({
Value: inputValue,
})
},
Tap() {
var that = this;
that.setData({
isFocus: true,
})
},
formSubmit(e) {
console.log(e.detail.value.password);
},
onLoad: function (options) {
},
onShow: function () {
},
})
边栏推荐
- PHP database connection version1.1
- 3、 Hikaricp source code analysis of connection acquisition process III
- 揭秘GES超大规模图计算引擎HyG:图切分
- Google cloud SSH enable root password login
- Network security detection and prevention test questions (4)
- Do you want to know how new investors open accounts? Is online account opening safe?
- Sorting out the latest data mining competition scheme!
- Why are life science enterprises on the cloud in succession?
- 网络安全检测与防范 练习题(三)
- 谈谈CNN中的位置和尺度问题
猜你喜欢
![[C language practice - print the upper triangle and its deformation (with blank version)]](/img/df/f38dc57c6a2de522acd91929ced1ad.png)
[C language practice - print the upper triangle and its deformation (with blank version)]

削足适履 - 谈谈赛道上的坡道改造

Kotlin compose terminate todo project Click to edit and modify todo

Process of vacuum and vacuum full

JVM|运行时数据区(堆空间)
![Analysis on market scale and supply of China's needle coke industry in 2020 [figure]](/img/79/6b08b62be8768484f548b6e18bd810.jpg)
Analysis on market scale and supply of China's needle coke industry in 2020 [figure]

Can GoogleSEO only do content without external chain? (e6zzseo)

ECS 7-day practical training camp (Advanced route) -- day04 -- build a portal using ECs and polardb

rmi-registry-bind-deserialization

ActiveMQ--CVE-2016-3088
随机推荐
[C language practice - print the upper triangle and its deformation (with blank version)]
What is an operator?
DataX script task development record
为什么生命科学企业都在陆续上云?
Uncover ges super large scale graph computing engine hyg: Graph Segmentation
最新数据挖掘赛事方案梳理!
MySQL view explanation
2020-12-09 laravel . Env file loading mechanism process
Trend ea- fixed stop loss and profit per order
Process of vacuum and vacuum full
Validation of TTF font by validator of laravel
MySQL transaction explanation
Analysis on planting area, output and import of sugarcane in Guangxi in 2021: the output of sugarcane in Guangxi accounts for 68.56% of the total output of sugarcane in China [figure]
JVM|运行时数据区(堆空间)
R language plot visualization: plot visualization of two-dimensional histogram contour (basic 2D histogram contour)
Tcp/ip test questions (II)
Server journey from scratch - Yu Zhongxian integrated version (IP access server, LNMP compilation and installation, Lua environment and socket expansion)
PHP FPM, workman, spoole, golang simple performance test
Do you want to know how new investors open accounts? Is online account opening safe?
Google cloud SSH enable root password login