92 lines
3.7 KiB
HTML
Executable File
92 lines
3.7 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 - Material Design Bootstrap 4</title>
|
|
<meta name="description" content="Material 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/material-forms/ajax-loaded-contact-form-1.html" />
|
|
|
|
<!-- Bootstrap 4 CSS -->
|
|
|
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
|
|
|
|
<!-- font-awesome CSS -->
|
|
|
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
|
|
<!-- demo styles -->
|
|
|
|
<link rel="stylesheet" href="../assets/css/code-preview-styles.min.css">
|
|
</head>
|
|
|
|
<body>
|
|
<h1 class="text-center">Php Form Builder - Ajax Contact Form for Wordpress, Joomla, Drupal or any CMS<br><small>Material Design Bootstrap 4 version</small></h1>
|
|
<div class="container">
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-11 col-lg-10">
|
|
<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="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
|
|
|
|
<!-- Bootstrap 4 JavaScript -->
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
|
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></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>
|