Activate keyboard layouts in forms

Activate keyboard layouts in forms

Detlef JaegerDetlef Jaeger Posts: 11Questions: 2Answers: 0
edited January 2019 in Free community support

Is there a possibility for mobile devices enabling the specific keyboard layout in forms or inline edit as provided in HTML5 (Input-Types)?

This question has accepted answers - jump to:

Answers

  • JoyrexJoyrex Posts: 92Questions: 14Answers: 3

    AFAIK, the keyboard layouts on mobile devices are triggered by the type attribute on the HTML input - so using valid HTML input types should trigger the appropriate keyboard.

    If it's not working, then I would suggest using your desktop browser Developer Tools and inspect the HTML to ensure your input types aren't being stripped out.

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    Which form input in DataTables / Editor is it that you want to do this?

    Allan

  • Detlef JaegerDetlef Jaeger Posts: 11Questions: 2Answers: 0

    Hello Joyrex,

    thanks for the answer.

    I forgot to mention that it's about the editor.
    The question is: Is there a possibility to force mobile devices the specific keyboard layout?

    (Input) type doesn't seem to work.

    $(document).ready(function() {
    editor = new $.fn.dataTable.Editor( {
    ajax: "../php/staff.php",
    table: "#example",
    fields: [ {
    label: "First name:",
    name: "first_name"
    }, {
    label: "Numeric:",
    name: " Numeric",
    type: " Numeric"
    }
    ]
    } );

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin
    Answer ✓

    Use:

    {
      label: "Numeric:",
      name: " Numeric",
      attr: {
        type: "number"
      }
    }
    

    That will apply the number type to the input element, allowing the browser to select the required keyboard type itself.

    Allan

  • Detlef JaegerDetlef Jaeger Posts: 11Questions: 2Answers: 0

    Hello allen,

    many thanks.

    This basically works but unfortunately not in my case.
    I have an input field for a formula - for example: (12 + 5) * 6 / 2
    With attr: {type: "number"} the correct keyboard layout is shown.
    However the input will not be saved.
    Is there a way to disable the number check?

    attr: {type: "tel"} works but the keyboard layout isn’t optimal.

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin
    Answer ✓

    I'm afraid that number check is provided by the browser when you use an input of type="number". That is not something that can be overridden as far as I'm aware.

    Allan

This discussion has been closed.