How to partition input field to appear as separate input fields on screen?

前端 未结 7 1828
半阙折子戏
半阙折子戏 2020-11-29 21:12

Look at the image:

I want design something like in the image, where a 4 digit one time password (OTP) is to be entered by user. Right now I have achieved th

7条回答
  •  再見小時候
    2020-11-29 21:38

    You can use the below directive if using AngularJS

    In your HTML add

    In your controller add

    $scope.otpInput={
            size:6,
            type:"text",
            onDone: function(value){
                console.log(value);
            },
            onChange: function(value){
                console.log(value);
            }
        };
    

    Plunker link

    UI component look and feel

    https://github.com/amstel91/otp-input-directive

提交回复
热议问题