5

Can anyone can suggest an alternative to Javascript prompt box that is better for young users?

prompt("Please enter your name:", "Harry Potter");

Check it out.

Since the input box needs to be designed for children, I want the prompt box to be more colorful and lively. Any suggested existing box that I can use?
The requirement is that I have to let the user enter a string, receiving it.

nycynik
  • 7,371
  • 8
  • 62
  • 87
Alston
  • 2,085
  • 5
  • 30
  • 49

6 Answers6

10

Have you tried out BootBox?

Bootbox.js is a small JavaScript library which allows you to create programmatic dialog boxes using Twitter’s Bootstrap modals, without having to worry about creating, managing or removing any of the required DOM elements or JS event handlers.

It has a very neat alternative to the default JavaScript Prompt box.

Vishnu
  • 2,024
  • 3
  • 28
  • 34
  • Note that all current versions of bootbox are affected by an advisory: https://www.npmjs.com/advisories/882/versions – Elliot Sep 19 '19 at 09:53
7

Have you tried the jQuery UI library?

Here you can see an example of a modal form

You can modify the styles or select from different themes.

hugohabel
  • 724
  • 6
  • 17
2

I find the browser's prompt (, confirm and delete) boxes extremely annoying.

Partly to solve this problem, I've written iocream.js. It's a sample wrapper around the DOM with two text-input methods: jin (read like C++ ' s cin) and jinarea.

You can find the docs at this bitbucket repo, and examples here.

Hope I helped.

EDIT: I've posted a similar answer here.

Community
  • 1
  • 1
Sumukh Barve
  • 1,414
  • 15
  • 12
1

the Jquery UI one's good: http://jqueryui.com/demos/dialog/

Liam
  • 27,717
  • 28
  • 128
  • 190
1

A jquery plugin named Impromptu gives you a lot of options not only for prompts but also for alerts and confirm boxes

Clyde Lobo
  • 9,126
  • 7
  • 34
  • 61
0

qtip2 is another nice free javascript library http://qtip2.com/

Cimbali
  • 11,012
  • 1
  • 39
  • 68