If you don't care much about layout of this pop-Up, just use window.confirm()
You can build this into your HTML form like this:
<html>
<script>
function checkForm() {
var message = "You entered following data:\n" +
"Car name: " + document.getElementById('cn').value + "\n" +
"Car color: " + document.getElementById('cc').value + "\n" +
"Is this correct?";
if (window.confirm(message))
document.getElementById("carform").submit();
}
</script>
<form id="carform" target="...">
Car name: <input type="text" name="carname" id="cn"/><br/>
Car color: <input type="text" name="carcolor" id="cc"/><br/>
<input type="button" value="submit" onclick="checkForm()"/>
</form>
</html>
EDIT To compare the entered values to the ones you have stored in your SQL database, you have to use PHP. You could realize it for example like this:
<html>
<script>
function checkForm() {
<?php
//Query the current databse values and store them for example in $carcolor $carname
echo 'var currentCarName = "' . $carname . '"';
echo 'var currentCarColor = "' . $carcolor . '"';
?>
var message = "You entered following data:\n" +
"Car name: " + document.getElementById('cn').value + "\n" +
" Old name: " + currentCarName + "\n" +
"Car color: " + document.getElementById('cc').value + "\n" +
" Old color: " + currentCarColor + "\n" +
"Is this correct?";
if (window.confirm(message))
document.getElementById("carform").submit();
}
</script>
<form id="carform" target="...">
Car name: <input type="text" name="carname" id="cn"/><br/>
Car color: <input type="text" name="carcolor" id="cc"/><br/>
<input type="button" value="submit" onclick="checkForm()"/>
</form>
</html>
Answer from lSoleyl on Stack OverflowWhat is the HTML tag for popups?
How to create a popup in HTML with CSS?
How to make a popup card in HTML?
Videos
If you don't care much about layout of this pop-Up, just use window.confirm()
You can build this into your HTML form like this:
<html>
<script>
function checkForm() {
var message = "You entered following data:\n" +
"Car name: " + document.getElementById('cn').value + "\n" +
"Car color: " + document.getElementById('cc').value + "\n" +
"Is this correct?";
if (window.confirm(message))
document.getElementById("carform").submit();
}
</script>
<form id="carform" target="...">
Car name: <input type="text" name="carname" id="cn"/><br/>
Car color: <input type="text" name="carcolor" id="cc"/><br/>
<input type="button" value="submit" onclick="checkForm()"/>
</form>
</html>
EDIT To compare the entered values to the ones you have stored in your SQL database, you have to use PHP. You could realize it for example like this:
<html>
<script>
function checkForm() {
<?php
//Query the current databse values and store them for example in $carcolor $carname
echo 'var currentCarName = "' . $carname . '"';
echo 'var currentCarColor = "' . $carcolor . '"';
?>
var message = "You entered following data:\n" +
"Car name: " + document.getElementById('cn').value + "\n" +
" Old name: " + currentCarName + "\n" +
"Car color: " + document.getElementById('cc').value + "\n" +
" Old color: " + currentCarColor + "\n" +
"Is this correct?";
if (window.confirm(message))
document.getElementById("carform").submit();
}
</script>
<form id="carform" target="...">
Car name: <input type="text" name="carname" id="cn"/><br/>
Car color: <input type="text" name="carcolor" id="cc"/><br/>
<input type="button" value="submit" onclick="checkForm()"/>
</form>
</html>
There's no native function for making a pop up message show up loading HTML. However there is FancyBox which does exactly this.
http://fancybox.net/
Look at this question and this blog for more information on how to do this