-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew_plan.php
81 lines (67 loc) · 2.75 KB
/
new_plan.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
require("includes/common.php");
if (!isset($_SESSION['user_id'])) {
header('location: login.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<!-- Head Tag -->
<?php include "includes/headTag.php"; ?>
<body>
<!-- navbar -->
<?php include "includes/header.php"; ?>
<!--end navbar -->
<!-- new plan form -->
<div class="container-fluid" id="cont1">
<div class="row row_style">
<div class="col-lg-6">
<div class="panel panel-default">
<div class="panel-heading" id="panelNewPlan">
<center>
<h4>CREATE NEW PLAN</h4>
</center>
</div>
<div class="panel-body">
<form action="newPlan_script.php" method="post">
<div class="form-group">
<label for="budget"> Initial Budget </label>
<input type="text" id="budget" class="form-control" placeholder=" Initial Budget(Ex.4000)" name="initialBudget" required="true" pattern="^[1-9]\d*(?:\.\d+)?$" >
</div>
<div class="form-group">
<label for="peoples">How many peoples you want to add in your groups? </label>
<input type="text" id="peopleCount" class="form-control" placeholder="No. of people" name="peoples" required="true" pattern="^[1-9]\d*$" oninvalid="setCustomValidity('Value must be greater than or equal to 1.')" oninput="setCustomValidity('')">
</div>
<button type="submit" class="btn btn-block btnNewPlan"> Next </button>
</form><br />
</div>
</div>
</div>
</div>
</div>
<!--end new plan-->
<!-- footer -->
<?php include "includes/footer.php"; ?>
</body>
<script>
// Checks budget value is minimum 50 rs.
var budget = document.getElementById("budget");
var peopleCount = document.getElementById("peopleCount");
budget.addEventListener("input",function(e){
var num = budget.value;
if( num < 50 ){
e.target.setCustomValidity('Value must be greater than or equal to 50.');
} else{
e.target.setCustomValidity('');
}
});
peopleCount.addEventListener("input",function(e1){
var num = peopleCount.value;
if( num < 0 ){
e1.target.setCustomValidity('Value must be greater than or equal 1.');
} else{
e1.target.setCustomValidity('');
}
});
</script>
</html>