In your display i cannot see where locationid form variable exists. you are just echoing it out.
Also, foreach() expects it's first parameter ($_POST['locationid'] in your case) to be an array. Which a single id is clearly not (unless you put it inside an array).
If you have multiple locationid's and updating multiple forms at once, you will have to iterate each form element for ex;
HTML:
<form>
<input name="locationid[0]">
<input name="location_name[0]">
<input name="location_date1[0]">
<input name="location_date2[0]">
--- second form
<input name="locationid[1]">
<input name="location_name[1]">
<input name="location_date1[1]">
<input name="location_date2[1]">
--- etc...
PHP:
<?php
if( isset( $_POST['locationid'] ) && count( $_POST['locationid'] ) >= 1){
foreach( $_POST['locationid'] as $formId => $locationId ){
$thisForm = array(
"id" => $locationId,
"name" => $_POST['location_name'][$formId],
"date1" => $_POST['location_date1'][$formId],
"date2" => $_POST['location_date2'][$formId]
);
// input validation etc
// then update database using new values gained.
}
}
?>