• Resolved acknowledge

    (@acknowledge)


    Hi, how can I make the search field only restricted to numbers only? So when tapping on the search field, automatically numbers only on your keybord will be become visible, becaue there is no need for letters anyway. Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @acknowledge

    The plugin applies the search-in-place behavior to the search box of WordPress. If you want to open only the number pads on mobiles, you must edit the type attribute in the search box input tag as a number: type="number" or you can add to this tag the pattern attribute as follows: pattern="[0-9]*"

    Best regards.

    Thread Starter acknowledge

    (@acknowledge)

    Thanks a lot @codepeople I am gonna try it out. Is there a specific php file in WordPress where I should change this?

    Plugin Author codepeople

    (@codepeople)

    Hello @acknowledge

    The search boxes are usually included by the themes through their template files. Furthermore, WordPress has a function that allows generating a search form: get_search_form

    The get_search_form function is defined into the “wp-includes/general-template.php” file.

    Best regards.

    Thread Starter acknowledge

    (@acknowledge)

    Excellent! Found it! Well explained mate.

    (For others information: my theme indeed has a searchform.php file and I applied above recommendation, but nothing happend. I found out I had another search plugin installed and after deactivating it, everything worked as a charm.)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Input value numbers only’ is closed to new replies.