Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Javascript - custom prompt, confirm, alert window

Notifications You must be signed in to change notification settings

Sehrentos/javascript-nprompt-form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

javascript-nprompt-form

A custom style prompt, confirm and alert for browsers.

  • Prompt values are serialized and return as object on submit.
  • Browser support(tested): IE9+, Mozilla/5.0 Gecko Firefox/38, Chrome/47

Example of use:

- (prompt)

	nprompt({
		title: "My prompt",
		message: "Type something...",
		input: [{
			"type": "text",
			"name": "test1",
			"placeholder": "Test 1",
			"required": "true"
		}, {
			"type": "textarea",
			"name": "test2",
			"placeholder": "Test 2"
		}, {
			"type": "radio",
			"name": "r1",
			"desc": "Radio test"
		}, {
			"type": "checkbox",
			"name": "c1",
			"desc": "Checkbox test"
		}, {
			"type": "date",
			"name": "date"
		}],
		onSubmit: function(obj) {
			console.log(obj);
		},
		onCancel: function() {
			console.log("Event cancel");
		}
	});

JS Fiddle

Happy editing.

About

Javascript - custom prompt, confirm, alert window

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published