How to make a popup in HTML? Different methods - Installation & Integration - Popupsmart Community
How to Make Form Pop Up Instead of Taking Over Full Mobile Screen? - Customize with code - Squarespace Forum
Pop-up Form responsive
How do I create a pop up modal on successful form submission?
Videos
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<form action="https://formsubmit.co/[email protected]" method="POST" class="form">
<input type="text" name="name" required>
<input type="email" name="email" required>
<button type="submit">Submit</button>
</form>
<script>
$(document).ready(function(){
$('.form').on('submit', function(){
swal("Title", "Message Content", "success", {
button: "Ok",
});
});
});
</script>
You can do following changes:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<form action="https://formsubmit.co/[email protected]" method="POST" class="form">
<input type="text" name="name" required>
<input type="email" name="email" required>
<button type="submit">Submit</button>
</form>
<script>
$(document).ready(function(){
$('.form').on('submit', function(){
alert('Your details were successfully received.');
});
});
</script>
You should use a page, not a popup(be it a modal or a new browser window).
Using a page makes the contact information more scaleable, you can add more to it later without having to worry about redoing the layout.
Another benefit using a page is that you can direct link to it. People can view the information AND explore the rest of your site.
Typically I don't advocate for pop ups unless really necessary. However there are some exceptions. IF the button 'Contact Sales' appears as a persistent button, then it makes sense that you want to keep the user in the task flow or context they were in when they decided to 'Contact Sales'. So, if your user will access this button frequently, while performing a task then have them fill out the form in a pop up. That way then perform this sub-task in context of their workflow, but when done they can close the form (pop up) and not have to click back their point of origin or workflow context.