I want to get the otp value after paste event.

 <div class="cod-enter-otp required enter-otp hidden mgt20 pmtd">
                <div class="field mrg0">
                    <label class="control-label label" for="otp">Enter OTP</label>
                    <div class="otp-control control">
                        <input type="text" name="otp" id="otp"  maxlength="6" class="input-text input-otp" data-bind="value:otp,disable:isDisabled,valueUpdate:'keyup,paste',event:{keyup:verifyOtp,paste:verifyOtp},hasFocus:isFocused">
                        <i class="bar"></i>


In js:

verifyOtp: function (value) { console.log(this.otp());
            var otp = this.otp(), self = this, payload;
            if (otp.length == 6) {}}

But not working.


  • Can you please show me what kinds of error you have got? – Pratik Mehta May 11 '19 at 10:32
  • No error. Copied value not pasted in text box. I'm trying to get otp it returns undefined – Mahi M May 11 '19 at 10:36
  • Would you please share js function verifyOtp ? – Pratik Mehta May 11 '19 at 10:38
  • Updated my post – Mahi M May 11 '19 at 10:40
  • otp() funtion ? – Pratik Mehta May 11 '19 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.