jmsadik
(jmsadik)
July 29, 2022, 2:58pm
1
When using a mobile device is there a way to force display of the numeric keypad when entering a price or quantity in a pricing field?
I enabled HTML5 output based on this topic: Is there a way to display the telephone keypad on mobile when expected to type in numbers only? [RESOLVED]
But keypad still doesn’t display for pricing fields. I also don’t get the keypad for zip codes. I’m not sure if the keypad displays for regular numeric fields.Thanks!
uamv
(Joshua Vandercar (Gravity Forms))
July 29, 2022, 4:18pm
2
Try the following PHP snippet:
// Open numeric keypad on mobile for number and quantity fields.
add_filter( 'gform_field_content', function( $content, $field, $value, $lead_id, $form_id ) {
if ( wp_is_mobile() && ( $field instanceof GF_Field_Number || $field instanceof GF_Field_Quantity ) ) {
$content = str_replace( "type='", "inputmode='decimal' type='", $content );
}
return $content;
}, 10, 5 );
system
(system)
Closed
August 28, 2022, 4:19pm
3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.