Form not sending mail

Hi,

I am at a loss. I tried mail( in the same format that I used for other forms on a website but it did not worked. I then tried another option but it takes me to the $error_page and does not send an email. The other forms send to a hotmail account so that shouldn’t be an issue.

My form is quite complex where certain divs with more questions show up if certain answers are given, but it seems to respond just as I wanted it to.

Could someone look at my code for sending the mail please. If you need to see the form then I can paste that here as well.

This is the original code:

<?php
if(isset($_POST['submit'])) {

$to = '[email protected]';
$visitor_email = $_POST['Email'];
$subject = 'New Submission from CascadeLP Land Form';
$message = 'Name: '. $_POST['Name'] . "\r\n\r\n";
$message .= 'If Owner: '. $_POST['ifowner'] . "\r\n\r\n";
$message .= 'Real Owner Name: '. $_POST['actualowner'] . "\r\n\r\n";
$message .= 'Email: '. $_POST['Email'] . "\r\n\r\n";
$message .= 'Phone: '. $_POST['Phone'] . "\r\n\r\n";
$message .= 'Time Zone: '. $_POST['timezone'] . "\r\n\r\n";
$message .= 'Call After: '. $_POST['callafter'] . "\r\n\r\n";
$message .= 'but Before: '. $_POST['callbefore'] . "\r\n\r\n";
$message .= 'Street Address: '. $_POST['street'] . "\r\n\r\n";
$message .= 'City: '. $_POST['city'] . "\r\n\r\n";
$message .= 'County: '. $_POST['county'] . "\r\n\r\n";
$message .= 'State: '. $_POST['state'] . "\r\n\r\n";
$message .= 'Zip Code: '. $_POST['zipcode'] . "\r\n\r\n";
$message .= 'APN: '. $_POST['apn'] . "\r\n\r\n";
$message .= 'Parcel Size: '. $_POST['parcelsize'] . "\r\n\r\n";
$message .= 'Parcel Size Units: '. $_POST['landunits'] . "\r\n\r\n";
$message .= 'Access to Land: '. $_POST['access'] . "\r\n\r\n";
$message .= 'Road Owner: '. $_POST['roadowner'] . "\r\n\r\n";
$message .= 'Type of Road Surface: '. $_POST['roadtype'] . "\r\n\r\n";
$message .= 'Other Surface Type Details: '. $_POST['othersurfacedetails'] . "\r\n\r\n";
$message .= 'Is there an Easement? : '. $_POST['easedescr'] . "\r\n\r\n";
$message .= 'Temporary Access if No Easement: '. $_POST['tempaccess'] . "\r\n\r\n";
$message .= 'Temporary Access Details: '. $_POST['tempaccessdetails'] . "\r\n\r\n";
$message .= 'Has a Survey been completed? : '. $_POST['ifsurvey'] . "\r\n\r\n";
$message .= 'Date of Survey: '. $_POST['datesurvey'] . "\r\n\r\n";
$message .= 'Has a Perc Test been done? : '. $_POST['ifperc'] . "\r\n\r\n";
$message .= 'Date of Perc Test: '. $_POST['dateperc'] . "\r\n\r\n";
$message .= 'Is there a Septic Permit? : '. $_POST['septicpermit'] . "\r\n\r\n";
$message .= 'Is the land in a Flood Zone? : '. $_POST['ifflood'] . "\r\n\r\n";
$message .= 'Is there Electric? : '. $_POST['ifelectric'] . "\r\n\r\n";
$message .= 'Is there an Alternative Electric Source? : '. $_POST['offgridelectric'] . "\r\n\r\n";
$message .= 'Off Grid Electric Details: '. $_POST['altelectricdetails'] . "\r\n\r\n";
$message .= 'Is there Water: '. $_POST['ifwater'] . "\r\n\r\n";
$message .= 'Date Well Drilled: '. $_POST['datewell'] . "\r\n\r\n";
$message .= 'Is the Well Water Drinkable? : '. $_POST['potablewellwater'] . "\r\n\r\n";
$message .= 'Is there a Sewer System? : '. $_POST['ifsewer'] . "\r\n\r\n";
$message .= 'Date Septic Tank Installed: '. $_POST['dateseptic'] . "\r\n\r\n";
$message .= 'Is there Natural Gas or Propane? : '. $_POST['ifgas'] . "\r\n\r\n";
$message .= 'Current Land Zoning: '. $_POST['currentzoning'] . "\r\n\r\n";
$message .= 'Are there Changes in Zoning planned for the Future? : '. $_POST['futurezoning'] . "\r\n\r\n";
$message .= 'Future Zoning Details: '. $_POST['futurezoningdetails'] . "\r\n\r\n";
$message .= 'Are there any Use Restrictions? : '. $_POST['restrictions'] . "\r\n\r\n";
$message .= 'Details of any Restrictions: '. $_POST['restrictiondetails'] . "\r\n\r\n";
$message .= 'Is Farming permitted? : '. $_POST['farming'] . "\r\n\r\n";$message .= 'Details if there are Farming Restrictions: '. $_POST['somefarmingdetails'] . "\r\n\r\n";
$message .= 'What is the Land being used for at this time? : '. $_POST['landuse'] . "\r\n\r\n";
$message .= 'Description of Land: '. $_POST['description'];

$headers = "From: [email protected] \r\n";
$headers .= "Reply-To: $visitor_email \r\n";
$headers .= 'Content-Type: text/plain; charset=utf-8';
$success = mail($to, $subject, $message, $headers);
}

 function IsInjected($str)
    {
      $injections = array('(\n+)',
                  '(\r+)',
                  '(\t+)',
                  '(%0A+)',
                  '(%0D+)',
                  '(%08+)',
                  '(%09+)'
                  );
      $inject = join('|', $injections);
      $inject = "/$inject/i";
      if(preg_match($inject,$str))
        {
        return true;
      }
      else
        {
        return false;
      }
    }

    ?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Land Form Acknowledgement</title>


</head>

<body>
    <script>
  fbq('track', 'Lead');
</script>

<?php if (isset($success) && $success) { ?>
<span style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif"><h1>Thank you</h1>
 Your information has been sent.</span><br><br>
  <span style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif">Please <a href=landformtest.php>Click Here</a> to take you back to the home page.</span>
<p>
  <?php } else { ?>
  <span style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif">
  Sorry, there was a problem sending your information. <br>
<br>
Please <a href=landformtest.php>Click Here</a> to try again.<br><br>

If you are still having an issue submitting the form successfully, then it may be worth trying another browser, or let us know at <a href="mailto:[email protected]">[email protected]</a> and we will respond as soon as possible. <br>
  </span><span style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif"><br>
  We apologize for any inconvenience.
  <?php } ?>
  
</span></p>
</body>
</html>

This is the newer attempt:

<?php
/*
This first bit sets the email address that you want the form to be submitted to.
You will need to change this value to a valid email address that you can access.
*/
$webmaster_email = "[email protected]";

/*
This bit sets the URLs of the supporting pages.
If you change the names of any of the pages, you will need to change the values here.
*/
$feedback_page = "landformtest.php";
$error_page = "landform_not_sent.html";
$thankyou_page = "landform_thank_you.html";

/*
This next bit loads the form field data into variables.
If you add a form field, you will need to add it here.
*/
$Name = $_REQUEST['Name'] ;
$ifowner = $_REQUEST['ifowner'] ;
$actualowner = $_REQUEST['actualowner'] ;
$Email = $_REQUEST['Email'] ;
$Phone = $_REQUEST['Phone'] ;
$timezone = $_REQUEST['timezone'] ;
$callafter = $_REQUEST['callafter'] ;
$callbefore = $_REQUEST['callbefore'] ;
$street = $_REQUEST['street'] ;
$city = $_REQUEST['city'] ;
$county = $_REQUEST['county'] ;
$state = $_REQUEST['state'] ;
$zipcode = $_REQUEST['zipcode'] ;
$apn = $_REQUEST['apn'] ;
$parcelsize = $_REQUEST['$parcelsize'] ;
$landunits = $_REQUEST['$landunits'] ;
$access = $_REQUEST['access'] ;
$roadowner = $_REQUEST['roadowner'] ;
$roadtype = $_REQUEST['roadtype'] ;
$othersurfacedetails = $_REQUEST['othersurfacedetails'] ;
$easedescr = $_REQUEST['easedescr'] ;
$tempaccess = $_REQUEST['tempaccess'] ;
$tempaccessdetails = $_REQUEST['tempaccessdetails'] ;
$ifsurvey = $_REQUEST['ifsurvey'] ;
$datesurvey = $_REQUEST['datesurvey'] ;
$ifperc = $_REQUEST['ifperc'] ;
$dateperc = $_REQUEST['dateperc'] ;
$septicpermit = $_REQUEST['septicpermit'] ;
$ifflood = $_REQUEST['ifflood'] ;
$ifelectric = $_REQUEST['ifelectric'] ;
$offgridelectric = $_REQUEST['offgridelectric'] ;
$altelecticdetails = $_REQUEST['altelectricdetails'] ;
$ifwater = $_REQUEST['ifwater'] ;
$datewell = $_REQUEST['datewell'] ;
$potablewellwater = $_REQUEST['potablewellwater'] ;
$ifsewer = $_REQUEST['ifsewer'] ;
$dateseptic = $_REQUEST['dateseptic'] ;
$currentzoning = $_REQUEST['currentzoning'] ;
$futurezoning = $_REQUEST['futurezoning'] ;
$futurezoningdetails = $_REQUEST['futurezoningdetails'] ;
$restrictions = $_REQUEST['restrictions'] ;
$restrictiondetails = $_REQUEST['restrictiondetails'] ;
$farming = $_REQUEST['farming'] ;
$somefarmingdetails = $_REQUEST['somefarmingdetails'] ;
$landuse = $_REQUEST['landuse'] ;
$description = $_REQUEST['description'] ;
$msg = 
"Name: " . $Name . "\r\n" . 
"If owner: " . $ifowner . "\r\n" . 
"Actual owner: " . $actualowner . "\r\n" . 
"Email: " . $Email . "\r\n" . 
"Phone: " . $Phone . "\r\n" .
"Time zone: " . $timezone . "\r\n" . 
"Call after: " . $callafter . "\r\n" . 
"But before: " . $callbefore . "\r\n" . 
"Property street address: " . $street . "\r\n" . 
"Property city: " . $city . "\r\n" . 
"Propety county: " . $county . "\r\n" . 
"Property state: " . $state . "\r\n" . 
"Property zipcode: " . $zipcode . "\r\n" . 
"APN: " . $apn . "\r\n" . 
"Parcel size: " . $parcelsize . "\r\n" . 
"Land units: " . $landunits . "\r\n" . 
"Access to land: " . $access . "\r\n" . 
"Road owner: " . $roadowner . "\r\n" . 
"Road surface type: " . $roadtype . "\r\n" . 
"Other surface type: " . $othersurfacedetails . "\r\n" . 
"Details of easement: " . $easedescr . "\r\n" . 
"Is temporary access available?: " . $tempaccess . "\r\n" . 
"Temporary access details: " . $tempaccessdetails . "\r\n" . 
"Has a survey been done? : " . $ifsurvey . "\r\n" . 
"Date of survey: " . $datesurvey . "\r\n" . 
"Has a perc test been done? : " . $ifperc . "\r\n" . 
"Date of perc test: " . $dateperc . "\r\n" . 
"Is there a septic permit? : " . $septicpermit . "\r\n" . 
"Is the land within a flood zone? : " . $ifflood . "\r\n" . 
"Is there electric? : " . $ifelectric . "\r\n" . 
"Is there an alternate source of electricity? : " . $offgridelectric . "\r\n" . 
"Details of the alt electric source: " . $altelecticdetails . "\r\n" . 
"Is there water? : " . $ifwater . "\r\n" . 
"Date well drilled: " . $datewell . "\r\n" . 
"Is the water drinkable? : " . $potablewellwater . "\r\n" . 
"Is there a sewer system? : " . $ifsewer . "\r\n" . 
"Date septic system was installed: " . $dateseptic . "\r\n" . 
"Current land zoning: " . $currentzoning . "\r\n" . 
"Are there plans to change the zoning?: " . $futurezoning . "\r\n" .
"Details of future zoning: " . $futurezoningdetails . "\r\n" .
"Are there any Use restrictions? : " . $restrictions . "\r\n" .
"Details of any restrictions: " . $restrictiondetails . "\r\n" .
"Is farming permitted? : " . $farming . "\r\n" .
"Details of any farming restrictions: " . $somefarmingdetails . "\r\n" .
"What is the land being used for at this time? : " . $landuse . "\r\n" .
"Description of land: " . $description ;

/*
The following function checks for email injection.
Specifically, it checks for carriage returns - typically used by spammers to inject a CC list.
*/
function isInjected($str) {
	$injections = array('(\n+)',
	'(\r+)',
	'(\t+)',
	'(%0A+)',
	'(%0D+)',
	'(%08+)',
	'(%09+)'
	);
	$inject = join('|', $injections);
	$inject = "/$inject/i";
	if(preg_match($inject,$str)) {
		return true;
	}
	else {
		return false;
	}
}

// If the user tries to access this script directly, redirect them to the feedback form,
if (!isset($_REQUEST['Email'])) {
header( "Location: $error_page" );
}

// If the form fields are empty, redirect to the error page.
elseif (empty($Name) || empty($Email) || empty($city) || empty($county) || empty($state)) {
header( "Location: $error_page" );
}

/* 
If email injection is detected, redirect to the error page.
If you add a form field, you should add it here.
*/
elseif ( isInjected($Email) || isInjected($Name) || isInjected($ifowner) || isInjected($actualowner) || isInjected($Phone) || isInjected($timezone) || isInjected($callafter) || isInjected($callbefore) || isInjected($street) || isInjected($city) || isInjected($county) || isInjected($state) || isInjected($zipcode) || isInjected($apn) || isInjected($parcelsize) || isInjected($landunits) || isInjected($access) || isInjected($roadowner) || isInjected($roadtype) || isInjected($othersurfacedetails) || isInjected($easedescr) || isInjected($tempaccess) || isInjected($tempaccessdetails) || isInjected($ifsurvey) || isInjected($datesurvey) || isInjected($ifperc) || isInjected($dateperc) || isInjected($septicpermit) || isInjected($ifflood) || isInjected($ifelectric) || isInjected($offgridelectric) || isInjected($altelecticdetails) || isInjected($ifwater) || isInjected($datewell) || isInjected($potablewellwater) || isInjected($ifsewer) || isInjected($dateseptic) || isInjected($currentzoning) || isInjected($futurezoning) || isInjected($futurezoningdetails) || isInjected($restrictions) || isInjected($restrictiondetails) || isInjected($farming) || isInjected($somefarmingdetails) || isInjected($landuse) || isInjected($description) ) {
header( "Location: $error_page" );
}

// If we passed all previous tests, send the email then redirect to the thank you page.
else {

	mail( "$webmaster_email", "Landform Results", $msg );

	header( "Location: $thankyou_page" );
}
?>

This code is not how to program an application. There are multiple different reasons that the code would go to the error page, but there’s no code in this code that would tell you (display/log) the reason why. There should be a unique and helpful error message for each user correctable error and for security related errors, you should log the actual information about the error, and output a generic failure message.

Also, programming is not about writing out line after line of code or conditional test for every possible value. That’s just assembly line typing that doesn’t accomplish anything useful and takes away from doing things that the code should have in it.

For a form that has more than about 2-3 fields, you should use a data-driven design, where you a have a data structure (array, database table) that holds the definition of the fields, with any validation tests, and any processing. You would then loop over this defining data to validate, then process the form data.

Post method form processing code should -

  1. Detect if a post method form has been submitted. There is a test in the 2nd code, but is about half way down in the code.
  2. Keep the input data as an array (arrays are for sets of things where each member in the set will be operated on in the same/similar way), then use elements in this array throughout the rest of the code.
  3. Trim all the data at once. After you do item #2, this can be accomplished using one single line of code.
  4. Validate all the inputs separately, storing user/validation errors in an array using the field name as the array index.
  5. After the end of all the validation logic, if the array holding the errors is empty, use the submitted form data.
  6. Any value that gets used in a html context, such as an email, should have htmlentities applied to it to insure that no css/html/javascript in a value will be rendered.
  7. The mail() call can fail and return a false value. If the call fails, you would add a failure message to the array holding the user/validation errors, and also log all the relevant data, so that you have information that may help determine why the call failed. For a true value, you would setup the success message. To display the success message, store it in a session variable, then you preform a redirect to the exact same url of the current page to cause a get request for the page. This will prevent the browser from re-submitting the form data should the user reload the page or navigate away from and back to the page. The code on the page would test, display, then clear the session variable.
  8. Every redirect needs an exit/die statement to stop php code execution.
  9. If there are errors at item #5, the code would continue on to display the error messages, redisplay the form, populating the form field values with their current values, so that the visitor doesn’t need to keep reentering data over and over.
  10. I do see an issue with the mail() call that could cause it to fail, no From: mail header, but since there’s no logic to test the value it returns and the code is going to the error page before it even gets to the mail call, this is not relevant yet.

If I/others have time, we will post an example showing these points.

Thank you so much. I don’t set up pages very often so use example scripts that I find. I understand html a little better have used some css, but having mail sent from a form confuses me as I don’t understand the process. I wish there was a programme where you could put in the form fields, answer some basic questions like format of email and it would generate the code. :confused:

See the following data-driven example -

<?php

// initialization 
session_start(); // used by success message/page

/*
This first bit sets the email address that you want the form to be submitted to.
You will need to change this value to a valid email address that you can access.
*/
$to = "[email protected]";
$from = "[email protected]";
$subject = "Landform Results";

// the form and form processing should be on the same page, therefore, any error output should be
// handled on that same page.
// after successfully completing the form processing, the code should redirect to the exact same url
// of the current page to cause a get request for that page.
// to display/trigger the display of a success message/page, you would store a value in a session
// variable, then, test, display, and clear the session variable at the appropriate location in
// the html document.
// if the mail() call fails, there's nothing the user can do to correct the problem. in this case, 
// you would log all the relevant data, and add a failure message to the array holding the errors.

// only values put into the mail header can be used to inject other headers.
// only the submitted email address should be put into a Reply-to: mail header, after validating
// that it is only and exactly one properly formatted email address, using php's filter validate
// email. this excludes control characters. it only includes alpha, numeric, and some printing characters.

/*
fields -
'Name', 'ifowner', 'actualowner', 'Email', 'Phone', 'timezone', 'callafter', 'callbefore',
'street', 'city', 'county', 'state', 'zipcode', 'apn', 'parcelsize', 'landunits', 'access',
'roadowner', 'roadtype', 'othersurfacedetails', 'easedescr', 'tempaccess', 'tempaccessdetails',
'ifsurvey', 'datesurvey', 'ifperc', 'dateperc', 'septicpermit', 'ifflood', 'ifelectric',
'offgridelectric', 'altelectricdetails', 'ifwater', 'datewell', 'potablewellwater', 'ifsewer',
'dateseptic', 'ifgas', 'currentzoning', 'futurezoning', 'futurezoningdetails', 'restrictions',
'restrictiondetails', 'farming', 'somefarmingdetails', 'landuse', 'description'
*/

// 1st code has - 'ifgas', not present in 2nd code

// required fields: Name, Email, city, county, state

// define fields
$fields = [];
// the main index is the field name
// only the first 2 are shown as examples, one required, one not
$fields['Name'] = ['label'=>'Name:', 'required'=>true];
$fields['ifowner'] = ['label'=>'If owner:', 'required'=>false];

// add elements for the rest of the fields...


$post = []; // array to hold a trimmed working copy of the form data
$errors = []; // array to hold user/validation errors

// post method form processing
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
	// trim all data
	$post = array_map('trim',$_POST); // if any field is an array, use a recursive trim call-back function here instead of php's trim function
	
	// validate inputs - required
	foreach($fields as $field=>$arr)
	{
		if( ($arr['required'] ?? false) && $post[$field] === '')
		{
			$errors[$field] = "{$arr['label']} is required.";
		}
	}
	
	// email format
	if(empty($errors['Email']) && !filter_var($post['Email'], FILTER_VALIDATE_EMAIL))
	{
		$errors['Email'] = 'Email is not formatted properly.';
	}
	
	// if no errors, use the submitted data
	if(empty($errors))
	{
		// build the message
		$msg = '';
		foreach($fields as $field=>$arr)
		{
			$msg .= htmlentities("{$arr['label']} $post[$field]",ENT_QUOTES) . "\r\n";
		}
		
		$headers = "From: $from\r\n";
		$headers .= "Reply-To: {$post['Email']}\r\n";
		$headers .= 'Content-Type: text/plain; charset=utf-8';
		if(mail($to, $subject, $msg, $headers ))
		{
			// mail call worked - doesn't actually mean that the email was sent or will be received
			// since email is error prone, you might want to record
			// (insert into database table or log to a file) the data here..
		}
		else
		{
			// failed, log data
			$log = "To:$to\n\nMsg:$msg\nHeaders:$headers\n------------------------------\n";
			file_put_contents('log.txt',$log, FILE_APPEND);
			
			$errors['mail'] = "Could not send the submitted data. The site owner has been notified.";
		}
	}
	// if no errors, success
	if(empty($errors))
	{
		$_SESSION['success'] = "Your submitted data has been sent.";
		die(header("Refresh:0"));
	}
}

// start the html document here...
?>

<?php
// output any success message/page
if(isset($_SESSION['success']))
{
	echo "<p>{$_SESSION['success']}</p>";
	unset($_SESSION['success']);
}
?>

<?php
// output any errors
if(!empty($errors))
{
	echo "<p>".implode('<br>',$errors)."</p>";
}
?>

<?php
// output the form, populating the field values with the corresponding values in $post
// apply htmlentities to each value to help prevent cross site scripting

// note: you can dynamically build the form fields, by looping over the $fields array. you would
// need to add elements to the definition for the field type (the following demo uses all type = text)
// and any other unique data needed to produce each field
?>
<form method='post'>
<?php
foreach($fields as $field=>$arr)
{
	echo "<label>{$arr['label']} <input type='text' name='$field' value='".htmlentities($post[$field] ?? '',ENT_QUOTES)."'></label><br>";
}
?>
<input type='submit'>
</form>

Besides the $to and $from email addresses, you need to finish creating the entries in the $fields array.

Thank you for spending so much time on this.

I assume that the entire form page code should be placed where states to put the html code.

I had originally hidden the ‘ifgas’ div as I decided not to use it but then deleted it entirely and just saved the code for it elsewhere.

My form has ‘required’ for specific fields so presume I should remove these as the php controls this now?

Thank you again. I will put it all together tomorrow and let you know how it goes.

All the best.

Yes.

You can leave them in. Client-side validation is a nicety for legitimate visitors that are actually using the form on your web page to submit the data. However, data submitted to the server-side code can come from anywhere, not just your form, can be anything, and cannot be trusted. You must validate data on the server before using it.

May I just clarify one more thing if you’ll be so kind? Do I need the section at the end as all my form data is in the html section. It is quite a complicated form that I have.

Or are there any fields tags I should add to my form code?

Also what should my form action be when submitting.

My apologies for my lack of understanding. Would it help if I pasted my original form code?

Thank you.

The form code that I posted is there both as an example of how you can dynamically produce the form as part of a data-driven design and so that I could have some form fields to test the posted code. The posted code is a standalone working example. You can try it as is to see what exactly it does and looks like (there will be php errors at the email format validation code since the Email field is not present in the $fields definition.)

For a html5 document, you can leave the entire action attribute out of the form tag to cause it to submit to the same page it is on.

If you want.

I will post the form page as it ‘works’ in terms of the drop downs, hidden divs etc. It took me a long time to get it 'right and respond the way I wanted it to and so I would prefer to keep it as is if at all possible.

Right now it’s action is to go to another php page to process the data to email. I am sorry it is so long.

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Land</title>
<link href="land.css" rel="stylesheet" type="text/css">
<style type="text/css">
a:link {
    color: #2E2E2E;
    text-decoration: none;
}
a:visited {
    text-decoration: none;
    color: #2E2E2E;
}
a:hover {
    text-decoration: none;
    color: #000000;
    font-weight: 500;
}

<hr style="height:5px; visibility:hidden;" />
a:active {
    text-decoration: none;
    color: #2E2E2E;
}
</style>

<style type="text/css">
textarea {
 font-size: 12;
font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
</style>

<!--The following script tag downloads a font from the Adobe Edge Web Fonts server for use within the web page. We recommend that you do not modify it.--><script>
var __adobewebfontsappname__="dreamweaver"

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
</script>

<script src="http://use.edgefonts.net/montserrat:n4:default;source-sans-pro:n2:default;basic:n4:default;bree-serif:n4:default;cabin:n4:default;convergence:n4:default;adamina:n4:default;alice:n4:default;droid-sans-mono:n4:default.js" type="text/javascript"></script>
<meta name="description" content="land is our business" /> 
<meta name="keywords" content="land" />

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
    $("#divowner").hide();
    $("#r1").click(function () {
        $("#divowner").show();
    });
    $("#r2").click(function () {
        $("#divowner").hide();
    });
});
</script>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script>

  function landaccessfunction(){
  getValue = document.getElementById("access").value;
  if(getValue == "road"){
    document.getElementById("roaddetails").style.display = "block";
    document.getElementById("easementdetails").style.display = "none";
    document.getElementById("noaccessdetails").style.display = "none";
  }
  if(getValue == "easement"){
    document.getElementById("roaddetails").style.display = "none";
    document.getElementById("easementdetails").style.display = "block";
    document.getElementById("noaccessdetails").style.display = "none";
  }
  if(getValue == "noaccess"){
    document.getElementById("roaddetails").style.display = "none";
    document.getElementById("easementdetails").style.display = "none";
    document.getElementById("noaccessdetails").style.display = "block";
  }
  if(getValue == "selectaccess"){
    document.getElementById("roaddetails").style.display = "none";
    document.getElementById("easementdetails").style.display = "none";
    document.getElementById("noaccessdetails").style.display = "none";
  }
}                </script>
            

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
    $("#tempaccessdetails").hide();
    $("#tayes").click(function () {
        $("#tempaccessdetails").show();
    });
    $("#tano").click(function () {
        $("#tempaccessdetails").hide();
    });
});
</script>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
    $("#percdetails").hide();
    $("#yesperc").click(function () {
        $("#percdetails").show();
    });
    $("#noperc").click(function () {
        $("#percdetails").hide();
    });
});
</script>


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
    $("#surveydetails").hide();
    $("#yessurvey").click(function () {
        $("#surveydetails").show();
    });
    $("#nosurvey").click(function () {
        $("#surveydetails").hide();
    });
});
</script>

<script>src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
    $("#electricdetails").hide();
    $("#electriconland").click(function () {
        $("#electricdetails").hide();
    });
	$("#adjacentelectric").click(function () {
        $("#electricdetails").hide();
    });

    $("#noelectric").click(function () {
        $("#electricdetails").show();
    });
});
</script>

<script>src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
    $("#altelectricdetails").hide();
    $("#yesaltelectric").click(function () {
        $("#altelectricdetails").show();
    });
    $("#noaltelectric").click(function () {
        $("#altelectricdetails").hide();
    });
});
</script>

<script>
$(document).ready(function () {
    $("#welldetails").hide();
    	$("#municipalwateronland").click(function () {
        $("#welldetails").hide();
    });
	$("#adjacentmunicipalwater").click(function () {
        $("#welldetails").hide();
    });

    	$("#well").click(function () {
        $("#welldetails").show();
    });
	$("#nowater").click(function () {
        $("#welldetails").hide();
    });

});
</script>

<script>src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
    $("#septicdetails").hide();
    $("#sewerlineonland").click(function () {
        $("#septicdetails").hide();
    });
	$("#adjacentsewerlines").click(function () {
        $("#septicdetails").hide();
    });

    $("#septicsystem").click(function () {
        $("#septicdetails").show();
    });
	$("#nosewer").click(function () {
        $("#septicdetails").hide();
    });


});
</script>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
    $("#futurezoningdetails").hide();
    $("#yeschangezoning").click(function () {
        $("#futurezoningdetails").show();
    });
    $("#nochangezoning").click(function () {
        $("#futurezoningdetails").hide();
    });
});
</script>


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
    $("#restrictiondetails").hide();
    $("#yesrestrictions").click(function () {
        $("#restrictiondetails").show();
    });
    $("#norestrictions").click(function () {
        $("#restrictiondetails").hide();
    });
});
</script>


<script>
$(document).ready(function () {
    $("#somefarmingdetails").hide();
    	$("#yesfarming").click(function () {
        $("#somefarmingdetails").hide();
    });
	$("#somefarming").click(function () {
        $("#somefarmingdetails").show();
    });

	$("#nofarming").click(function () {
        $("#somefarmingdetails").hide();
    });

});
</script>




	</head>
<header></header>
<body bgcolor="#E8F1FD">

  <section id="maincontent"> 
        

<div id="landinfo" align="left">
	<p>
	  
    <span style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif">We are interested...</span></p>
	<p>
	  Please fill out the form below. For general enquiries, please provide your basic details using this<span style="font-weight: 700"> <a href="contactus.php"><u style="font-style: italic">Contact Form</u></a></span>.)<br>
	  <br>
	  Thank you.<br>
	  <br>
    </p>
</div>
<form method="post" id="landform" action="landformsend_mail.php">
    <p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: bold; font-weight: 300; font-size: large;">
     	      <label for="Name">*Name:</label>
     	      <input style="height:20px;font-size:12pt; name="Name" type="text" required="required" id="Name" form="landform" size="50" maxlength="80">
   	          
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Are you the legal owner?
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifowner" id="r2" value="yesowner" form="landform" checked>Yes</label>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifowner" id="r1" value="noowner" form="landform" onClick="getResultsbyID("divowner")">No</label>

<div class="text" id="divowner" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: large;">                
Name of Legal Owner<br><input style="height:20px;font-size:12pt; name="actualowner" type="text" id="actualowner" form="landform" size="50">
</div>
  	            
<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: large;">
<label for="email">
              *Email:</label>
              <input style="height:20px;font-size:12pt; name="Email" type="email" required="required" id="email" form="landform" size="40" maxlength="60">
              <label for="tel"><br>
                <br>
                Phone:</label>
     	      <input style="height:20px;font-size:12pt; name="Phone" type="tel" id="tel" form="landform" size="30">
     	   &nbsp;</p>
     	    <p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: large;">
     	      <label for="timezone">Time Zone:</label>
     	      <select style="height:24px;font-size:12pt; name="timezone" id="timezone" form="landform">
     	        <option>Eastern</option>
     	        <option>Central</option>
     	           	          </select>            
     	    <p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: large;">
     	      <label for="callafter">Best Time to Call:&nbsp;</label>
              <select style="height:24px;font-size:12pt; name="callafter" id="callafter" form="landform">
    <option value="06:00">06.00 AM</option>
    <option value="07:00">07.00 AM</option>
    <option value="08:00">08.00 AM</option>
    <option value="09:00" selected="">09.00 AM</option>
    <option value="10:00">10.00 AM</option>
    </select>
             
	<label for="callbefore">to</label>
	<select style="height:24px;font-size:12pt; name="callbefore" id="callbefore" form="landform">
	  <option value="19:00">07.00 PM</option>
	  <option value="20:00" selected="">08.00 PM</option>
	  <option value="21:00">09.00 PM</option>
	  <option value="22:00">10.00 PM</option>
	  <option value="23:00">11.00 PM</option>
	  <option value="00:00">12:00 AM</option>
	  </select>
            <br><br><br>

     	      <span style="font-style: oblique; font-weight: 600;">Property Address:</span>
     	      <label for="street"><br>
     	        <br>
   	          Street Address <span class='smallerfont'>(if applicable)</span> :</label>
     	      <input style="height:20px;font-size:12pt; name="street" type="text" id="street" form="landform" size="50" maxlength="80">
     	      <label for="city"><br>
     	        <br>
   	          *City:</label>
     	      <input style="height:20px;font-size:12pt; name="city" type="text" required="required" id="city" form="landform" size="40" maxlength="60">
     	      &nbsp; 
<label for="county"><br>
     	        <br>
   	          *County:</label>
     	      <input style="height:20px;font-size:12pt; name="county" type="text" required="required" id="county" form="landform" size="40" maxlength="60">
     	      &nbsp; 
     	      <label for="state"><br>
     	        <br>
   	          *State:</label>
     	      <select style="height:24px;font-size:12pt; name="state" required="required" id="state" form="landform">
     	        <option value="AL">AL</option>
     	        <option value="AK">AK</option>
     	        </select><br>
<br>
       	      <label for="zipcode">Zip Code:</label>
     	      <input style="height:20px;font-size:12pt; name="zipcode" type="text" id="zipcode" form="landform" max="10" min="5" size="20" maxlength="20">
     	      <br>
     	      <br>
     	    </p>
<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: large;">
		<label for="APN">APN:</label>
              <input style="height:20px;font-size:12pt; name="apn" type="text" id="apn" form="landform" size="30" maxlength="30">
              <label>
<br><br>
     	      <label for="parcelsize">Parcel Size:</label>
              <input style="height:20px;font-size:12pt; name="parcelsize" type="text" id="parcelsize" form="landform" size="15" maxlength="20">
       <label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
     	        <input name="landunits" type="radio" id="landunits_acres" form="landform" value="acres" checked>
     	        acres</label>
              <label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
     	        <input name="landunits" type="radio" id="landunits_sqft" form="landform" value="sqft">
     	        sqft</label>
<br><br><br>

How is the land accessed?
<select style="height:24px;font-size:12pt;" name="access" 
  id="access" 
  onChange="landaccessfunction()" 
  class="form-control" 
  form="landform">
  <option value="selectaccess" checked>Select One</option>
  <option value="road">Direct road access</option>
  <option value="easement">A legally deeded easement</option>
  <option value="noaccess">No legal access</option>
</select>

<div class="coloreddiv" id="roaddetails" style="display:none;">

  	  <label for="roadowner">Who owns and maintains the road?<br>
	  </label>
      <textarea name="roadowner" cols="50" rows="2" id="roadowner" form="landform"></textarea>
<br><br>

Access road surface type(s) while approaching land:
<div>
      <input type="checkbox" id="ashphalt" name="roadtype" value="ashphalt" form="landform">
      <label for="ashphalt">ashphalt</label>
    </div>
<div>
      <input type="checkbox" id="gravel" name="roadtype" value="gravel" form="landform">
      <label for="gravel">gravel</label>
    </div>
<div>
      <input type="checkbox" id="dirt" name="roadtype" value="dirt" form="landform">
      <label for="dirt">dirt</label>
    </div>
<div>
      <input type="checkbox" id="othersurface" name="roadtype" value="othersurface" form="landform">
      <label for="othersurface">other</label>
<input style="height:20px;font-size:12pt; name="othersurfacedetails" type="text" id="othersurfacedetails" form="landform" size="40" maxlength="40">
<br><br>
    </div>


</div>

<div class="coloreddiv" id="easementdetails" style="display:none;">
  <label for="easedescr">Easement details (e.g. approximate length, dirt/gravel, through private property, etc.):<br>
	  </label>
      <textarea name="easedescr" cols="50" rows="2" id="easedescr" form="landform"></textarea>
<br><br>

</div>

<div class="coloreddiv" id="noaccessdetails" style="display:none;">
  Is there a way to access the property temporarily (e.g. special permission to cross private land)?<br>


<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="tempaccess" id="tayes" value="yestempaccess" form="landform" onClick="getResultsbyID("tempaccessdetails")">Yes</label>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="tempaccess" id="tano" value="notempaccess" form="landform" checked>No</label>

<div class="coloreddiv" id="tempaccessdetails" style="display:none;"><br><label for="tempaccessdetails">Please explain:<br>
	  </label><textarea name="tempaccessdetails" cols="50" rows="2" id="tempaccessdetails" form="landform"></textarea></div>

</div>

<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: bold; font-weight: 300; font-size: large;"><br>

Has a survey been completed?
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifsurvey" id="yessurvey" value="yessurvey" form="landform">Yes</label>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifsurvey" id="nosurvey" value="nosurvey" form="landform" onClick="getResultsbyID("surveydetails")">No</label>

<div class="coloreddiv" id="surveydetails" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">                

Date/Year of survey: <input style="height:20px;font-size:12pt; name="datesurvey" type="text" id="datesurvey" form="landform" size="8">
</div>
</p>

<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: bold; font-weight: 300; font-size: large;">
Has a percolation test been performed?
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifperc" id="yesperc" value="yesperc" form="landform">Yes</label>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifperc" id="noperc" value="noperc" form="landform" onClick="getResultsbyID("percdetails")">No</label>

<div class="coloreddiv" id="percdetails" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">                

Date/Year of test: <input style="height:20px;font-size:12pt; name="dateperc" type="text" id="dateperc" form="landform" size="8"><br><br>
Is there a septic permit?
       <label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
     	        <input name="septicpermit" type="radio" id="yessepticpermit" form="landform" value="yessepticpermit">
     	        Yes</label>
              <label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
     	        <input name="septicpermit" type="radio" id="nosepticpermit" form="landform" value="nosepticpermit">
     	        No</label>
</div>

</p>

<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: bold; font-weight: 300; font-size: large;"><br>
Does the property lie within a flood zone?
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifflood" id="allflood" value="allflood" form="landform">Fully</label>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifflood" id="partiallyflood" value="partiallyflood" form="landform">Partially</label>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifflood" id="noflood" value="noflood" form="landform">No</label>
</p>

<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: bold; font-weight: 300; font-size: large;"><br>
Are the following utilities on or nearby the property?

</p>

<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: bold; font-weight: 300; font-size: large;">
Electric Power Lines: 
<br>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifelectric" id="electriconland" value="electriconland" form="landform">On property</label>
<br>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifelectric" id="adjacentelectric" value="adjacentelectric" form="landform">At road or on adjacent property</label>
<br>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifelectric" id="noelectric" value="noelectric" form="landform" onClick="getResultsbyID("electricdetails")">None</label>

<div class="coloreddiv" id="electricdetails" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">                

Is there an alternate electric source on property (e.g. solar or wind)?
       <label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
     	        <input name="offgridelectric" type="radio" id="yesaltelectric" form="landform" value="yesaltelectric">
     	        Yes</label>
              <label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
     	        <input name="offgridelectric" type="radio" id="noaltelectric" form="landform" value="noaltelectric" onClick="getResultsbyID("altelectricdetails")>
     	        No</label>


<div class="coloreddiv" id="altelectricdetails" style="display:none;"><br><label for="altelectricdetails">Please describe:<br>
	  </label><textarea name="altelectricdetails" cols="50" rows="3" id="altelectricdetails" form="landform"></textarea></div>

</div>


<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: bold; font-weight: 300; font-size: large;">
Water: 
<br>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifwater" id="municipalwateronland" value="municipalwateronland" form="landform">Municipal water on property</label>
<br>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifwater" id="adjacentmunicipalwater" value="adjacentmunicipalwater" form="landform">Municipal water at road or on adjacent property</label>
<br>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifwater" id="well" value="well" form="landform" onClick="getResultsbyID("welldetails")">Well</label>
<br>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifwater" id="nowater" value="nowater" form="landform">None</label>


<div class="coloreddiv" id="welldetails" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">                

Date/Year well was drilled: <input style="height:20px;font-size:12pt; name="datewell" type="text" id="datewell" form="landform" size="8"><br><br>
Is the water potable?
       <label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
     	        <input name="potablewellwater" type="radio" id="yespotable" form="landform" value="yespotable">
     	        Yes</label>
              <label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
     	        <input name="potablewellwater" type="radio" id="notpotablewellwater" form="landform" value="notpotablewellwater">
     	        No</label>

</div>

</p>


<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: bold; font-weight: 300; font-size: large;">
Sewage: 
<br>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifsewer" id="sewerlineonland" value="sewerlineonland" form="landform">Municipal sewer line on property</label>
<br>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifsewer" id="adjacentsewerlines" value="adjacentmunicipalwater" form="landform">Municipal sewer lines at road or on adjacent property</label>
<br>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifsewer" id="septicsystem" value="septicsystem" form="landform" onClick="getResultsbyID("septicdetails")">Septic system</label>
<br>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="ifsewer" id="nosewer" value="nosewer" form="landform">None</label>


<div class="coloreddiv" id="septicdetails" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">                

Year septic system was installed: <input style="height:20px;font-size:12pt; name="dateseptic" type="text" id="dateseptic" form="landform" size="8"><br><br>

</div>

</p>



<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: large;">

<br>
	  <label for="currentzoning">What is the property currently zoned for?<br>
	  </label>
      <textarea name="currentzoning" cols="50" rows="3" id="currentzoning" form="landform"></textarea>
	</p>


<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: bold; font-weight: 300; font-size: large;"><br>

Are there plans to change the zoning in the future?
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="futurezoning" id="yeschangezoning" value="yeschangezoning" form="landform">Yes</label>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="futurezoning" id="nochangezoning" value="nochangezoning" form="landform" onClick="getResultsbyID("futurezoningdetails")">No</label>

<div class="coloreddiv" id="futurezoningdetails" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">                

<label for="futurezoningdetails">Future zoning details: <br>
	  </label>
      <textarea name="futurezoningdetails" cols="50" rows="3" id="futurezoningdetails" form="landform"></textarea>
</div>
</p>


<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: bold; font-weight: 300; font-size: large;"><br>

Any restrictions? <span class='smaller'>(e.g. building types or sizes permitted etc.)</span>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="restrictions" id="yesrestrictions" value="yesrestrictions" form="landform">Yes</label>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="restrictions" id="norestrictions" value="norestrictions" form="landform" onClick="getResultsbyID("futurezoningdetails")">No</label>

<div class="coloreddiv" id="restrictiondetails" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">                

<label for="restrictiondetails">Restriction details:<br>
	  </label>
      <textarea name="restrictiondetails" cols="50" rows="3" id="restrictiondetails" form="landform"></textarea>
</div>
</p>

<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: bold; font-weight: 300; font-size: large;"><br>
Is farming allowed <span class='smaller'>(e.g. livestock, crops etc.)</span>?

<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="farming" id="yesfarming" value="yesfarming" form="landform">Yes</label>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="farming" id="somefarming" value="somefarming" form="landform" onClick="getResultsbyID("somefarmingdetails")">Some</label>
<label style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">
<input type="radio" name="farming" id="nofarming" value="nofarming" form="landform">No</label>


<div class="coloreddiv" id="somefarmingdetails" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: medium;">                

<label for="somefarmingdetails">Please explain:<br>
	  </label>
      <textarea name="somefarmingdetails" cols="50" rows="3" id="somefarmingdetails" form="landform"></textarea>
</div>

</p>

<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: large;">

<br>
	  <label for="landuse">What is the land currently used for?<br>
	  </label>
      <textarea name="landuse" cols="50" rows="3" id="landuse" form="landform"></textarea>
	</p>
  	        
	<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 300; font-size: large;">

<br>
	  <label for="description">Description of land <span class='smaller'>(e.g. hilly, grass, oak trees, pond, suitable building site etc.):</span><br>
	  </label>
      <textarea name="description" cols="50" rows="3" id="description" form="landform"></textarea>
	</p>

   	    <p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: oblique; font-weight: 300; font-size: medium;">*required</p>
     	    <p>
     	      <input style="height:30px;font-size:14pt; name="reset" type="reset" id="reset" form="landform" value="reset">
     	      <input style="height:30px;font-size:14pt; name="submit" type="submit" id="submit" form="landform" value="submit">
     	    </p>
     	  </form>
<br>
</section>

</body>	
</html>

Please note: I removed some options from the state, call times and time zones, as well as most text from the page to reduce character count.

There is room for improvement/simplification in the form markup and there’s at least one issue where a required field(s) doesn’t work like you think.

For the required attribute to work for a select/option menu, the first option choice must be an empty string. In at least the state menu, the first option choice is a state selection, so this will pass the required test and the first choice will be submitted if the visitor doesn’t make a selection. It is customary that the first option choice be an empty value with the text being a prompt to make a selection (which you do have is a some cases.)

Didn’t look at everything, but here’s a list that will simplify the markup -

  1. The required attribute only needs to be present or absent. You don’t have to have it present and assigned a true/non-empty string. Just put required in or leave it out.
  2. The form=“landform” attribute is only needed if a field is not between the <form></form> tags (having fields outside their form tag is a bad practice anyways.) Since all your fields are inside the form, there’s no need for this attribute.
  3. If you put the <label></label> around the field it goes with, you don’t need the for=’…’ attribute nor the matching id=’…’ attribute. You are doing this in some cases, but not all.
  4. Any id attributes that are not used should be removed.
  5. The repetitive in-line styling should be handled using css classes.
  6. Though it is not an issue now, with the required attributes, you should repopulate the form field values with any existing submitted data should there be a user/validation error.
  7. The repeated loading of jquery is unnecessary. Also, several of them contain syntax errors anyways.
  8. There are a number of errors in the markup. You should validate the result web page at validator.w3.org

You can convert, as a learning exercise, the form to be built dynamically as part of the data-driven design. You can even do this in small steps.

You would add a type=’…’ element to the entries in the $fields array that you want to be built dynamically. This would hold the field type. You would then add a switch/case statement, to account for the differences for each field type, in the code looping to build the form. For any field entry that has a type=’…’ element defined for it, the php code would create the markup for that field and add it to an array of data to populate a template entry with. You would then put a matching template tag, e.g. {field_name} into the html document for each field that is getting built dynamically. By doing this one field or one field type at a time, you can design, write, test, and debug the code a small step at a time, while keeping all the other form fields defined as is.

Sponsor our Newsletter | Privacy Policy | Terms of Service