in shiny, how to insert numpad?

Firstly , I'm new to programing, shiny & R. I'm trying to insert numpad to enable the user to easily pick numbers as same as mobile device, but it didnt work.

The javascript code that I'm trying to add is this:

<script type="text/javascript">
var picker = new ax5.ui.picker();
 $(document.body).ready(function () {
    picker.bind({
        target: $('[data-ax5picker="numpad"]'),
        direction: "auto",
        content: {
            width: 200,
            margin: 10,
            type: 'numpad',
            config: {
                btnWrapStyle: "padding:3px;width:25%;",
                btnStyle: "width:100%",
                btnTheme: "primary",
                specialBtnWrapStyle: "padding:3px;width:25%;",
                specialBtnStyle: "width:100%;padding-left:0px;padding-right:0px;",
                specialBtnTheme: ""
                /*
                 keyArray: [
                 {value: "7"},
                 {value: "8"},
                 {value: "9"},
                 {label: "BS", fn: "back"},
                 {value: "4"},
                 {value: "5"},
                 {value: "6"},
                 {value: "-"},
                 {value: "1"},
                 {value: "2"},
                 {value: "3"},
                 {value: ""},
                 {value: "."},
                 {value: "0"},
                 {value: ""},
                 {label: "OK", fn: "close"}
                 ]
                 */
            },
            formatter: {
                pattern: 'number'
            }
        },
        onStateChanged: function () {
            //console.log(this);
        }
    });
  });
 </script>

Below is the shiny code that I'm trying to create

library(shiny)
library(shinyCleave)
library(shinyjs)
library(shinyjqui)

ui <- fluidPage(
             includeCleave(),
phoneInput("phone","Mobile Number")
)

server <- shinyServer(function(input, output, session) {

cleave(session, "#num", list(
    numeral = TRUE,
    numeralThousandsGroupStyle= 'wan'
))
})
shinyApp(ui=ui,server=server)

on the other hand, is there any way to increase the maximum number of entries in mobile number field.

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