# Verification code component bug

**URL:** <https://community.weweb.io/t/verification-code-component-bug/4087>\
**Category:** Ask us anything\
**Created:** [August 29, 2023, 1:33pm UTC](https://community.weweb.io/t/verification-code-component-bug/4087 "2023-08-29T13:33:18Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![GeovanyFerreira](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/geovanyferreira/32/13093_2.png) [@GeovanyFerreira](https://community.weweb.io/u/GeovanyFerreira)\
**Post date:** [August 29, 2023, 1:33pm UTC](https://community.weweb.io/t/verification-code-component-bug/4087/1 "2023-08-29T13:33:18Z")

</div>

In the first component I went to use this one but I found some bug because in the final entry it doesn’t limit to 1 digit or remove the focus.  
In the second, it does not advance to the next one, having to do it manually.  
Could someone tell me if this is really a bug?

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [August 29, 2023, 3:28pm UTC](https://community.weweb.io/t/verification-code-component-bug/4087/2 "2023-08-29T15:28:18Z")

</div>

Hi @GeovanyFerreira 👋

I didn’t understand your question.

From what I can see, you tried to create a verification code interface using the `Tabs` element but I’m not sure how you built it or what you’d like the end result to look like so it’s hard to help.

Can you tell us a bit more what you’re trying to build (e.g. by sharing a design) and how you built the current iteration with screenshots or a short video walking us through the different elements and workflows?

---

<div class="post-metadata">

**Author:** ![Jack](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/jack/32/5915_2.png) [@Jack](https://community.weweb.io/u/Jack)\
**Post date:** [August 29, 2023, 4:52pm UTC](https://community.weweb.io/t/verification-code-component-bug/4087/3 "2023-08-29T16:52:22Z")

</div>

@GeovanyFerreira yes, this is a UX bug with the ‘Secure Code’ pre-built components. I recommend using the verification code component and styling it similar to the ‘Secure Code’ component, if that’s what you’re looking for.

---

<div class="post-metadata">

**Author:** ![raelyn](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/raelyn/32/2803_2.png) [@raelyn](https://community.weweb.io/u/raelyn)\
**Post date:** [August 30, 2023, 7:06am UTC](https://community.weweb.io/t/verification-code-component-bug/4087/4 "2023-08-30T07:06:28Z")

</div>

Yes, that’s how it is unfortunately… I made a thread recently about using some code to get it to behave how you like.

> [@Question about "secure code - 4" Weweb element](https://community.weweb.io/t/question-about-secure-code-4-weweb-element/3676/4):
>
> Sure! The code I use was (this is for on change workflow on the first box), replace with your own variable values. Then do something very similar to the second and third box~ // Access the global variables let code1Value = variables[‘’]; let code2Value = variables[‘’]; let code3Value = variables[‘’]; let code4Value = variables[‘’]; // Check if the length of code1Value is more than 1 if (code1Value.length \> 1) { // If it is, add the second character to code2Value code2Value += code1Value…

Although that workaround works, but in the end i abandoned it as its too complex, I just use a normal input field now.

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [August 30, 2023, 8:04am UTC](https://community.weweb.io/t/verification-code-component-bug/4087/5 "2023-08-30T08:04:07Z")

</div>

Aaaaah ok, got it now! Sorry, it took me a while. 😅

I’ll let the tech team know about the bug on the `Secure code` components.

---

<div class="post-metadata">

**Author:** ![GeovanyFerreira](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/geovanyferreira/32/13093_2.png) [@GeovanyFerreira](https://community.weweb.io/u/GeovanyFerreira)\
**Post date:** [September 5, 2023, 12:31pm UTC](https://community.weweb.io/t/verification-code-component-bug/4087/6 "2023-09-05T12:31:03Z")

</div>

sorry for not being very specific Joyce thanks for always helping us

---

<div class="post-metadata">

**Author:** ![GeovanyFerreira](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/geovanyferreira/32/13093_2.png) [@GeovanyFerreira](https://community.weweb.io/u/GeovanyFerreira)\
**Post date:** [September 5, 2023, 12:32pm UTC](https://community.weweb.io/t/verification-code-component-bug/4087/7 "2023-09-05T12:32:28Z")

</div>

thanks @raelyn a great component but it has some bugs, I believe that the WeWeb team will be solving it soon

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [September 5, 2023, 2:51pm UTC](https://community.weweb.io/t/verification-code-component-bug/4087/8 "2023-09-05T14:51:45Z")

</div>

> [@GeovanyFerreira](#):
>
> sorry for not being very specific Joyce thanks for always helping us

No worries at all! Happy to help 🙂

> [@GeovanyFerreira](#):
>
> thanks @raelyn a great component but it has some bugs, I believe that the WeWeb team will be solving it soon

Yeaaah indeed. The team is looking into it. I’ll keep you posted when there’s a fix.

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [September 6, 2023, 12:34pm UTC](https://community.weweb.io/t/verification-code-component-bug/4087/9 "2023-09-06T12:34:25Z")

</div>

Quick update on this one: the team managed to fix part of the issue on the `Secure code` element inside the WeWeb Editor but it’s still buggy in published apps so we opened a new bug ticket to look into _that_ issue.

---

<div class="post-metadata">

**Author:** ![GeovanyFerreira](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/geovanyferreira/32/13093_2.png) [@GeovanyFerreira](https://community.weweb.io/u/GeovanyFerreira)\
**Post date:** [September 6, 2023, 1:19pm UTC](https://community.weweb.io/t/verification-code-component-bug/4087/10 "2023-09-06T13:19:02Z")

</div>

Thank you for your speed, in the published application the bug happened mainly in the mobile version, thank you for your usual willingness

---

<div class="post-metadata">

**Author:** ![luka](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/luka/32/1571_2.png) [@luka](https://community.weweb.io/u/luka)\
**Post date:** [September 8, 2023, 10:18am UTC](https://community.weweb.io/t/verification-code-component-bug/4087/11 "2023-09-08T10:18:22Z")

</div>

While we work on fixing the code input, what you can do is following:

Use a basic input of type: Number.  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/e/e13993fb9af1fdf56b633c05a4a09317f27bc3b4.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/b/bc90208c697e440f5a1bbd649c09d6fa1c20f373.png)

After that you can navigate to settings and add two HTML attributes:

name: `oninput`  
value: `javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);`

name: `maxlength`  
value `6` // Any number of digits you want in your code input

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/4ff4349764b29f15921620c24c34a25140fc2c28.png)

---

<div class="post-metadata">

**Author:** ![luka](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/luka/32/1571_2.png) [@luka](https://community.weweb.io/u/luka)\
**Post date:** [November 15, 2023, 12:02pm UTC](https://community.weweb.io/t/verification-code-component-bug/4087/12 "2023-11-15T12:02:32Z")

</div>

Masked input was released today so for anyone looking for an easy way to implement a code input this works out of the box with WeWeb

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/8/8625031fff24616503499614af17ff595c4d5d42.png)

---

<div class="post-metadata">

**Author:** ![GeovanyFerreira](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/geovanyferreira/32/13093_2.png) [@GeovanyFerreira](https://community.weweb.io/u/GeovanyFerreira)\
**Post date:** [November 15, 2023, 1:25pm UTC](https://community.weweb.io/t/verification-code-component-bug/4087/13 "2023-11-15T13:25:52Z")

</div>

OWWWWW, @luka  
It will further speed up development and user experience.  
Thank you very much WeWeb team

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [November 15, 2023, 1:37pm UTC](https://community.weweb.io/t/verification-code-component-bug/4087/14 "2023-11-15T13:37:41Z")

</div>

So that’s how the new UI will look. Slick. Nice.

---

<div class="post-metadata">

**Author:** ![luka](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/luka/32/1571_2.png) [@luka](https://community.weweb.io/u/luka)\
**Post date:** [November 15, 2023, 1:57pm UTC](https://community.weweb.io/t/verification-code-component-bug/4087/15 "2023-11-15T13:57:29Z")

</div>

its a lot cooler than just this 😶‍🌫️

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [November 15, 2023, 1:59pm UTC](https://community.weweb.io/t/verification-code-component-bug/4087/16 "2023-11-15T13:59:00Z")

</div>

I’m not expecting anything less from you @luka I dig your style, it’s very unique.
