# 'numeric' field type for 'type-in' cards

**URL:** <https://forums.ankiweb.net/t/numeric-field-type-for-type-in-cards/56896>\
**Category:** Card Design\
**Created:** [March 8, 2025, 7:17pm UTC](https://forums.ankiweb.net/t/numeric-field-type-for-type-in-cards/56896 "2025-03-08T19:17:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexChe](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@AlexChe](https://forums.ankiweb.net/u/AlexChe)\
**Post date:** [March 8, 2025, 7:17pm UTC](https://forums.ankiweb.net/t/numeric-field-type-for-type-in-cards/56896/1 "2025-03-08T19:17:16Z")

</div>

First, please apologize me in case this has been answered already. I have a strong feeling that it should’ve, but I have no luck finding the answer.

I have a deck where all the cards are type-in, and all the answers are integer numbers (this is a deck I’ve created for my daughter to learn multiplication table). Everything works fine, except that every time the input field is selected, the default keyboard is shown on mobile device, and you need to change it to numeric keyboard first to be able to type the answer.

So the question is, is there a way to somehow mark the field as ‘numeric’, so that numeric keyboard would show up automatically? Something like the ‘inputmode=numeric’ HTML attribute.

---

<div class="post-metadata">

**Author:** ![Anon\_0000](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Anon\_0000](https://forums.ankiweb.net/u/Anon_0000)\
**Post date:** [March 8, 2025, 7:38pm UTC](https://forums.ankiweb.net/t/numeric-field-type-for-type-in-cards/56896/2 "2025-03-08T19:38:57Z")

</div>

I cannot test this on mobile but maybe something like the following would work?

```auto
<script>
	input = document.getElementById("typeans");
	input.setAttribute("inputmode", "numeric");
</script>

```

---

<div class="post-metadata">

**Author:** ![AlexChe](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@AlexChe](https://forums.ankiweb.net/u/AlexChe)\
**Post date:** [March 9, 2025, 9:59am UTC](https://forums.ankiweb.net/t/numeric-field-type-for-type-in-cards/56896/3 "2025-03-09T09:59:24Z")

</div>

Thanks a lot.  
I’ve tried it, and on desktop Anki while debugging with QTWEBENGINE\_REMOTE\_DEBUGGING I can see in inspector, that the attribute is indeed added to the element. But on mobile apps (both in AnkiMobile and AnkiDroid) for some reason the numeric keyboard is still not shown, and normal keyboard is shown instead. I’ve also tried “type”=“number” and “type”=“tel”, and “pattern”=“[0-9]\*” with no luck. Seems like either the script is not working on mobile webviews for some reason or the attributes are just not enough in this case. I’m gonna find out if there is a way to inspect what’s really going on mobile webview, similarly to QTWEBENGINE\_REMOTE\_DEBUGGING on desktop.

---

<div class="post-metadata">

**Author:** ![Anon\_0000](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Anon\_0000](https://forums.ankiweb.net/u/Anon_0000)\
**Post date:** [March 9, 2025, 10:49am UTC](https://forums.ankiweb.net/t/numeric-field-type-for-type-in-cards/56896/4 "2025-03-09T10:49:39Z")

</div>

**Edit:** Nevermind, you actually tried that already.

---

<div class="post-metadata">

**Author:** ![sorata](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/sorata/32/34115_2.png) [@sorata](https://forums.ankiweb.net/u/sorata)\
**Post date:** [March 9, 2025, 12:14pm UTC](https://forums.ankiweb.net/t/numeric-field-type-for-type-in-cards/56896/5 "2025-03-09T12:14:35Z")

</div>

I don’t know how AnkiMobile works. In AnkiDroid, do this:

1. **Settings \> Advanced**.
2. Find **Type answer into the card**.
3. Turn this on.

Now, does it work? In my experience, this is basically THE issue when dealing with most AnkiDroid input issues. I tried and the above steps did lead to a resolution.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [April 8, 2025, 12:14pm UTC](https://forums.ankiweb.net/t/numeric-field-type-for-type-in-cards/56896/6 "2025-04-08T12:14:42Z")

</div>

Closed on April 8, 2025, 12:14pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
