Skip to content
Snippets Groups Projects
Commit 3ca6d7bd authored by William Sutanto's avatar William Sutanto
Browse files

inputorder validation, fix order styling, hover button

parent ff8f22d1
Branches
No related merge requests found
......@@ -168,17 +168,19 @@ img.driver-image{
}
.driver-information .vote-rate {
font-size: 10px;
font-size: 20px;
}
.star {
width: 20px;
height: 20px;
vertical-align: center;
}
.ratenumber {
color: gold;
font-weight: bold;
font-weight: bold;
font-size: 25px;
}
.ichoosebutton {
......@@ -218,3 +220,17 @@ p.noResult {
text-align: center;
margin-top: 30px;
}
span.wrongMark{
float: none;
color: red;
visibility: hidden;
}
.green-button input:hover {
background-color: goldenrod
}
.ichoosebutton:hover {
background-color: goldenrod
}
\ No newline at end of file
......@@ -25,7 +25,7 @@
<ul id="nav">
<?php
$class1 = ($page == "order_destination") ? 'class="active"' : '';
$class1 = ($page == "order") ? 'class="active"' : '';
$class2 = ($page == "history") ? 'class="active"' : '';
$class3 = ($page == "my_profile") ? 'class="active"' : '';
......
......@@ -36,7 +36,7 @@
<body>
<?php
$idUser = ($_GET["id_active"]);
$page = "order_destination";
$page = "order";
include 'header.php';
?>
<div id='pageTitleMyProfile'>
......@@ -58,14 +58,14 @@
</div>
</div>
<?php
echo "<form method='post' action='order_driver.php?id_active=".$_GET["id_active"]."'>";
echo "<form method='post' id='destinationform' onSubmit='return validatePlace()' action='order_driver.php?id_active=".$_GET["id_active"]."'>";
?>
<div class="form-group">
<label>Picking point</label>
<label>Picking point<span id="pickingPointMark" class="wrongMark">*</span></label>
<input type="text" class="input-control" name="picking_point">
</div>
<div class="form-group">
<label>Destination</label>
<label>Destination<span id="destinationMark" class="wrongMark">*</span></label>
<input type="text" class="input-control" name="destination">
</div>
<div class="form-group">
......@@ -79,5 +79,33 @@
</body>
<script type="text/javascript">
document.getElementById("select-destination").style.backgroundColor = "#fffe9f";
function validatePlace() {
var pickingpoint = document.forms["destinationform"]["picking_point"].value;
var destination = document.forms["destinationform"]["destination"].value;
var wrongInput = [];
if (pickingpoint=="") {
document.getElementById("pickingPointMark").style.visibility= "visible";
wrongInput.push("picking point");
} else
document.getElementById("pickingPointMark").style.visibility= "hidden";
if (destination=="") {
document.getElementById("destinationMark").style.visibility= "visible";
wrongInput.push("destination");
} else
document.getElementById("destinationMark").style.visibility= "hidden";
if (wrongInput.length>0) {
var output = "You have to input your ";
for (i=0; i<wrongInput.length-1; i++) {
output+= wrongInput[i]+"and ";
}
output+= wrongInput[wrongInput.length-1];
alert(output);
return false;
}
else {
return true;
}
}
</script>
</html>
\ No newline at end of file
......@@ -12,7 +12,7 @@
<body>
<?php
$idUser = ($_GET["id_active"]);
$page = "order_driver";
$page = "order";
include 'header.php';
?>
<div id='pageTitleMyProfile'>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment