<script>
$('.what-prompted').remove();
</script>
http://codepen.io/siwicki/live/zqyVdX
For your form you need to prefix your input
names with form_logger_
Example: name="form_logger_input-name"
<form action="" method="post">
<label for="first-name">First Name</label>
<input name="form_logger_first_name" id="first-name" />
</form>
Place the following above a HTML form.
<?php
if (!empty($_POST)) {
global $siteData, $siteDefineData;
require_once ENV_ROOT.'/portal/libraries/formLogger.api.php';
$logger = new formLoggerApi();
$logger->setSiteId($siteData['site.id']);
$logger->setSessionId($siteDefineData['cms_tracking_sessions']['session.id']);
$logger->setFormId('form_logger_');
$logger->setFormName('Form Name');
$logger->setcustomEmailSubject('Subject');
$logger->setNotificationEmailAddresses('john@john.com');
if ($logger->saveData($_POST)) {
echo '<h1>Thank you!!</h1>';
echo '<p>Extra content?</p>';
} else {
echo '<h1>It looks like something went wrong.</h1>';
}
}
?>
Need a little extra Juice for your Free Estimate pages? Note the hidden input as well as the name attribute for the form elements. Anything
<input type="hidden" value="How did you hear about us?" name="custom_field_1_name" />
<div class="servicetype">
<label for="custom_field_1">How did you hear about us?</label>
<select class="required" name="custom_field_1">
<option value="" selected="selected">Please Select...</option>
<option>Ads (Online)</option>
<option>Angie's List</option>
<option>Other</option>
</select>
</div>
Processing checkboxes can be a pain. This script can add the values to a hidden input to make it easier.
<input type="hidden" name="form_logger_Interested_In" id="interested_in" value="">
$('input[type=checkbox]').change(function() {
var vals = $('input[type=checkbox]:checked').map(function() { return $(this).val(); }).get().join(',');
$('#interested_in').val(vals);
});
<?php
// matchup up your fields with new source
$data = array(
'firstname' => $_POST['form_logger_First_Name'],
'lastname' => $_POST['form_logger_Last_Name'],
'phone1' => $_POST['form_logger_Phone'],
'email1' => $_POST['form_logger_Email_Address'],
'streetaddress' => $_POST['form_logger_Street'],
'city' => $_POST['form_logger_City'],
'state' => $_POST['form_logger_State'],
'zip' => $_POST['form_logger_Zip_Code']
);
$serialize = http_build_query($data);
//
$request = curl_init('url here');
curl_setopt($request, CURLOPT_POST, 1);
curl_setopt($request, CURLOPT_POSTFIELDS, $serialize);
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($request);
curl_close($request);
?>
Need to add a “type of service” field to free estimate form that automatically changes association in portal Lead. Add to “before borders”:
<?php
if (!empty($_POST) || ($_SERVER['REQUEST_URI'] == "/free-estimate/confirmation.html") )
{
global $siteData;
$siteData['association.id'] = $_POST['association'];
}
?>
Add to “borders” before