wecuro_blog/php-form-builder/templates/foundation-forms/ajax-loaded-contact-form-1.html

82 lines
2.9 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">
<title>Ajax Contact Form for Wordpress, Joomla, Drupal - Foundation</title>
<meta name="description" content="Foundation 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/foundation-forms/ajax-loaded-contact-form-1.html" />
<!-- Foundation CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.0/css/foundation.min.css" rel="stylesheet">
<!-- foundation icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.min.css">
</head>
<body>
<h1 class="text-center">Php Form Builder - Ajax Contact Form for Wordpress, Joomla, Drupal or any CMS<br><small>Foundation version</small></h1>
<div class="grid-container">
<div class="grid-x grid-padding-x">
<div class="small-10 small-offset-1 medium-8 medium-offset-2 cell">
<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>
<!-- 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>