Skip to content

Commit

Permalink
Making the selects PROPERLY...Erik!
Browse files Browse the repository at this point in the history
  • Loading branch information
MFox committed Apr 23, 2017
1 parent 9f20bc6 commit e7c16de
Showing 1 changed file with 27 additions and 20 deletions.
47 changes: 27 additions & 20 deletions Wello/www/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@

<li id="get-gps-local">
<label for="gps-coordinates">GPS coordinates
<img onclick="getLocation()" alt="get location" src="img/gps.svg">
<img onclick="getLocation()" alt="get location" src="img/gps.svg">
</label>
<p id="demo"></p>
<label for="gps-coordinates">Latitude</label>
Expand Down Expand Up @@ -211,30 +211,37 @@

<li>
<label for="use">Use</label>
<select id="use" onchange='showOther(this.value, this);'>
<option <?php if ($row['Proposed_Use'] == 'DOMESTIC'){echo 'selected="selected"';} ?> value="Domestic">Domestic</option>
<option <?php if ($row['Proposed_Use'] == 'BUISNESS ESTABLISHMENT'){echo 'selected="selected"';} ?> value="Buisness Establishment">Buisness Establishment</option>
<option <?php if ($row['Proposed_Use'] == 'DOMESTIC'){echo 'selected="selected"';} ?> value="Farm">Farm</option>
<option <?php if ($row['Proposed_Use'] == 'DOMESTIC'){echo 'selected="selected"';} ?> value="Test Well">Test Well</option>
<option <?php if ($row['Proposed_Use'] == 'DOMESTIC'){echo 'selected="selected"';} ?> value="Public Supply">Public Supply</option>
<option <?php if ($row['Proposed_Use'] == 'DOMESTIC'){echo 'selected="selected"';} ?> value="Industrial">Industrial</option>
<option <?php if ($row['Proposed_Use'] == 'DOMESTIC'){echo 'selected="selected"';} ?> value="Air Conditioning">Air Conditioning</option>
<option <?php if ($row['Proposed_Use'] == 'DOMESTIC'){echo 'selected="selected"';} ?> value="Other">Other</option>
</select>
<?php
$ProposedArray = array('DOMESTIC','BUSINESS ESTABLISHMENT','FARM','TEST WELL','PUBLIC SUPPLY','INDUSTRIAL','AIR CONDITIONING','OTHER');
echo'<select id="use">';
foreach ($ProposedArray as $value) {
//sticky form implementation for drop down, set selected to previous user input
if ($row['Proposed_Use'] == $value) {
echo '<option value="' . $value . '" selected="selected">' . $value . '</option>';
} else {
echo '<option value="' . $value . '">' . $value . '</option>';
}
}
echo '</select>';
?>
<input value="" type="text" id="other-use-case" class="other">
</li>

<li>
<label for="drilling-equipment">Drilling equipment</label>
<select value="<?php
//Should add ternary operator for nulls and blanks
echo $row['Drilling_Equipment'];
?>" id="drilling-equipment">
<option value="Rotary">Rotary</option>
<option value="Compressed Air Percussion">Compressed Air Percussion</option>
<option value="Cable Percussion">Cable Percussion</option>
<option value="Other">Other</option>
</select>
<?php
$DrillingEquipArray = array('ROTARY','COMPRESSED AIR PERCUSSION','CABLE PERCUSSION','OTHER');
echo'<select id="use">';
foreach ($DrillingEquipArray as $value) {
//sticky form implementation for drop down, set selected to previous user input
if ($row['Proposed_Use'] == $value) {
echo '<option value="' . $value . '" selected="selected">' . $value . '</option>';
} else {
echo '<option value="' . $value . '">' . $value . '</option>';
}
}
echo '</select>';
?>
<input value="" type="text" id="other-equipment" class="other">
</li>

Expand Down

0 comments on commit e7c16de

Please sign in to comment.