Skip Navigation

[Resolved] Bring up the numpad (numeric keypad) on mobile for numeric fields.

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to show the numeric keypad when entering a number field with a mobile device.

Solution: There's no built-in way to do this. You could try a custom JavaScript approach that switches the input type.

This support ticket is created 5 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by Christian Cox 5 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#1345371

I'd like to force the numeric pad (numpad) on mobile for all of my numeric text fields in my cred form. It'll be great if I could use the "inputmode=decimal" html attribute...but any other method that does the job for both iOS and Android devices will do.

#1345619

Hello, at this time there isn't a built-in way to choose a different keyboard style for each input field in a Form. The text input type is used for most of the simple fields. However, you might be able to use custom JavaScript to manipulate the system-generated inputs after the page with the Form is rendered. Here's an example of setting a property on a basic text input field:

jQuery(document).ready(function($) {
    setTimeout(function() {
        $('input[name="wpcf-fieldslug"]').prop('property','value');
    }, 500 );
});

In this example you would change fieldslug to match your custom field slug, change property to the name of the input property you want to manipulate, and change value to the desired property value. I have used type=number in the past...I'm not familiar with inputmode=decimal, but the process would be basically the same. This workaround isn't ideal, so if you'd like to see specific soft keypad support added to the software, I encourage you to submit your request over here: https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

Your submissions could influence which features are added to the software in the future.

#1346593

My issue is resolved now. Thank you!

One final ask: what are the setbacks of using this method?

#1346655

One final ask: what are the setbacks of using this method?
- The main thing to keep in mind is this is not how the software was intended to be used. It is not tested or guaranteed to work, and bugs related to this type of custom field manipulation will not be addressed by our developers. The types of problems that this workaround may introduce are unknown and unpredictable. However if this is a major project requirement, then you may test it out and find it works well enough to justify those risks.

- The input type is not correct when the Form is first loaded on the front-end of the site. This code switches the input type after a short period of time. Ideally the input would be the correct type when the page is first loaded, but the change happens so fast it probably won't be possible to see or use the wrong input type in the Form.

- The input type in wp-admin is not identical to the input type in Forms. This means it may be possible to enter data in one side that is invalid on the other side. I'm not sure, I would keep that in mind when testing.

- After the Form is submitted, different things can happen depending on the configurations. If the page reloads and the Form is still visible, I would test the input field for a second submission.