Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Force numeric key pad to appear in mobile view

I have a similar query to this past forum post: https://www.sawtoothsoftware.com/forum/13930/force-numeric-keyboard-for-mobile-device?show=13930#q13930

This works fine in a standard O/E question.

I have a grid question with 2 rows and 1 column as follows:

Pa1_r1_c1 (name)
Pa1_r2_c1 (phone number)

Both row variables are O/E.

I'd like to force the numeric keypad to appear only for row 2 in mobile view (the phone number).

I thought this would work but the alphabetical keypad appears:
    $('#[% P1a_r2_c1%]').attr('type', 'tel');

Any suggestions? Thank you.
asked Jul 22, 2018 by Paul Moon Platinum (101,255 points)

1 Answer

0 votes
As-is, your code is going to try to change the type attribute on an element whose ID is the *response* of P1a_r2_c1.  You need to change the type attribute on the element whose ID is P1a_r2_c1.

    $('#P1a_r2_c1').attr('type', 'tel');
answered Jul 23, 2018 by Zachary Platinum Sawtooth Software, Inc. (214,575 points)
Thanks once again Zachary. Much appreciated for the solution.