88 lines
3.1 KiB
HTML
Executable File
88 lines
3.1 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
<title>Ajax Contact Form for Wordpress, Joomla, Drupal - Bootstrap 3</title>
|
|
<meta name="description" content="Bootstrap 3 Ajax Form Generator - how to create an Ajax Contact Form with Php Form Builder for Wordpress, Joomla, Drupal or any CMS">
|
|
<link rel="canonical" href="https://www.phpformbuilder.pro/templates/bootstrap-3-forms/ajax-loaded-contact-form-1.html" />
|
|
|
|
<!-- Bootstrap 3 CSS -->
|
|
|
|
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
<!-- demo styles -->
|
|
|
|
<link rel="stylesheet" href="../assets/css/code-preview-styles.min.css">
|
|
|
|
<style type="text/css">#user-phone {border-radius: 0 4px 4px 0;}</style>
|
|
</head>
|
|
<body>
|
|
<h1 class="text-center">Php Form Builder - Ajax Contact Form for Wordpress, Joomla, Drupal or any CMS<br><small>Bootstrap 3 version</small></h1>
|
|
<div class="container">
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-11 col-lg-10 col-lg-offset-1">
|
|
<p>The Ajax form source code is not available on this page, you'll find it in the <em>templates/ajax-forms</em> folder</p>
|
|
<div id="ajax-form"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- jQuery -->
|
|
|
|
<script src="//code.jquery.com/jquery.min.js"></script>
|
|
|
|
<!-- Bootstrap JavaScript -->
|
|
|
|
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
|
|
|
<!-- Ajax form loader -->
|
|
|
|
<script type="text/javascript">
|
|
var $head= document.getElementsByTagName('head')[0],
|
|
target = '#ajax-form';
|
|
|
|
var loadData = function(data, index) {
|
|
if (index <= $(data).length) {
|
|
var that = $(data).get(index);
|
|
if ($(that).is('script')) {
|
|
// output script
|
|
var script = document.createElement('script');
|
|
script.type = 'text/javascript';
|
|
if (that.src != '') {
|
|
script.src = that.src;
|
|
script.onload = function() {
|
|
loadData(data, index + 1);
|
|
};
|
|
$head.append(script);
|
|
} else {
|
|
script.text = that.text;
|
|
$('body').append(script);
|
|
loadData(data, index + 1);
|
|
}
|
|
} else {
|
|
// output form html
|
|
$(target).append($(that));
|
|
loadData(data, index + 1);
|
|
}
|
|
} else {
|
|
$.holdReady(false);
|
|
}
|
|
};
|
|
|
|
$(document).ready(function() {
|
|
$.ajax({
|
|
url: 'ajax-forms/contact-form-1.php',
|
|
type: 'GET'
|
|
}).done(function(data) {
|
|
$.holdReady(true);
|
|
loadData(data, 0);
|
|
}).fail(function(data, statut, error) {
|
|
console.log(error);
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|