0

I have a prompt popup in an application when moving stock around in the warehouse and our users use mobile phones for their warehouse work with limited space for adding <input> fields. Instead there's a prompt when they click an icon when they want to move something to somewhere else.

The locations are all numbers, and to make it easier for the workers it would be great if the phone only showed the numpad.

I have searched both stackoverflow and google, and I keep hitting pages talking about doing this for the <input> which is simple enough, but can't find any information on if this is even possible for window.prompt()

Daniel Nordh
  • 362
  • 3
  • 15
  • 1
    As described here: https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt the `prompt()` takes only two arguments and neither of them does what you wish. If I were you, I would go with a modal. You could put an `` control inside it and style the whole modal to be very similar to the `window.prompt()` – Sebastian Kaczmarek Dec 05 '19 at 07:46
  • 1
    This answer may be helpful: https://stackoverflow.com/a/5235760/7080548 – Sebastian Kaczmarek Dec 05 '19 at 07:58
  • That is an excellent idea. – Daniel Nordh Dec 05 '19 at 08:08

1 Answers1

1

window.prompt() does not have many customization options as you want. The fitting solution would be going with a custom popup. You may find a relevant reference here: How to personalize alert buttons - window.confirm() and window.alert()

Sebastian Kaczmarek
  • 8,120
  • 4
  • 20
  • 38
kkk
  • 26
  • 2
  • Thanks for your answer. Made me find some bootstrap options for modals that will get me going. https://getbootstrap.com/docs/4.0/components/modal/ – Daniel Nordh Dec 05 '19 at 08:28