ItSolutionStuff.com

JQuery Bootbox Modal Dialog Prompt Example

By Hardik Savani • June 6, 2023
jQuery

We sometimes need to use prompt with input in our project because if we use prompt modal is very interesting and specially for GUI. Always we like to use prompt modal for creating data or editing data and also for conformation. In this example i use bootbox JS for prompt modal with input that way we can get input value easily.

You can try this:

Example:

<html lang="en">

<head>

<title>Jquery - bootstrap Prompt modal using bootbox.js</title>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>

<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/css/bootstrap.css" rel="stylesheet">

<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/js/bootstrap.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/bootbox.js/4.4.0/bootbox.min.js"></script>

</head>

<body>


<div class="container text-center">

<h2>Jquery - bootstrap Prompt modal using bootbox.js</h2>

<button class="btn btn-success">Click Here</button>

</div>


<script type="text/javascript">

$("button").click(function(){

bootbox.prompt("Write sometext here?", function(result) {

$("button").after("<br/>Your Text: " + result);

});

});

</script>


</body>

</html>

I hope it can help you...

Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

PHP JQuery Ajax Post Request Example

Read Now →

How to Disable Browser Back Button using JQuery?

Read Now →

PHP MySQL Confirmation Before Delete Record using Ajax Example

Read Now →

How to Change Date Format in JQuery?

Read Now →

PHP JQuery Ajax Image Upload Example Tutorial

Read Now →

PHP Ajax Dependent Dropdown List Example

Read Now →

How to Copy Text to Clipboard without Flash using JQuery?

Read Now →

How to Get Gravatar Image from Email using JQuery?

Read Now →

How to Stop Setinterval() After Sometimes in JQuery?

Read Now →

How to Remove Comma from String in JQuery?

Read Now →

PHP Crop Image Before Upload using Croppie JS Example

Read Now →

How to Get IP Address in JQuery?

Read Now →

Check and Uncheck All Checkbox using JQuery Example

Read Now →

How to Check Undefined, Empty and Null in JQuery?

Read Now →