-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost.html
More file actions
93 lines (86 loc) · 3.85 KB
/
Copy pathpost.html
File metadata and controls
93 lines (86 loc) · 3.85 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PhoneModelAPI</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<style>
label {
margin-bottom: 6px;
}
</style>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">PhoneModelAPI</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="/">Home</a></li>
<li><a href="/get">Get</a></li>
<li><a href="#">Post</a></li>
<li><a href="/update">Update</a></li>
<li><a href="/delete">Delete</a></li>
</ul>
</div>
</nav>
<div class="container-fluid">
<iframe name="hiddenFrame" width="0" height="0" border="0" style="display: none;"></iframe>
<div class="col-sm-2" style="background-color:lavender;">
<form action="/api/v1/manufacturers" method="post" target="hiddenFrame">
<label for="manufacturer">Post manufacturer:</label>
<input type="text" id="manufacturer" name="manufacturer"><br>
<input type="submit" value="POST">
</form>
</div>
<div class="col-sm-10" style="background-color:lavenderblush;">
<label class="col-sm-10">Post phone:</label>
<div class="col-sm-3">
<label for="mfr">Manufacturer</label>
</div>
<div class="col-sm-7">
<input type="text" id="mfr" name="big_form" onfocusout="addManufacturerToUrl()">
</div>
<form action="/api/v1/manufacturers/" method="post" target="hiddenFrame" id="postForm">
<div class="col-sm-3">
<label for="model_name">Model name</label> <br>
<label for="release_date">Release date</label><br>
<label for="weight_g">Weight (gram)</label><br>
<label for="display_size_inch">Display size (inch)</label><br>
<label for="resolution">Resolution</label><br>
<label for="camera">Camera (MP)</label><br>
<label for="battery_capacity">Battery capacity (mAh)</label><br>
<label for="operating_system">Operating system</label><br>
<label for="os_version">OS Version</label><br>
<label for="category">Category</label><br>
</div>
<div class="col-sm-7">
<input type="text" id="model_name" name="model_name"><br>
<input type="date" id="release_date" name="release_date"><br>
<input type="text" id="weight_g" name="weight_g"><br>
<input type="text" id="display_size_inch" name="display_size_inch"><br>
<input type="text" id="resolution" name="resolution"><br>
<input type="text" id="camera" name="camera"><br>
<input type="text" id="battery_capacity" name="battery_capacity"><br>
<input type="text" id="operating_system" name="operating_system"><br>
<input type="text" id="os_version" name="os_version"><br>
<input type="text" id="category" name="category"><br>
<input type="submit" value="POST">
</div>
</form>
</div>
</div>
</body>
<script>
function addManufacturerToUrl() {
document.getElementById('postForm').setAttribute ("action" , "/api/v1/manufacturers/" + document.getElementById('mfr').value);
}
</script>
</html>