-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo_advanced.html
156 lines (125 loc) · 5.24 KB
/
demo_advanced.html
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<!DOCTYPE html>
<html lang="en" class="h-100">
<!-- h-100 for sticky footer -->
<head>
<script src="./demo_advanced.js"></script>
<script src="./urlform.min.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffffff">
<title>URLFormJS</title>
<link rel="stylesheet" id="bootstrapCSS" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<style>
#CustomShareURL {
word-wrap: break-word;
max-width: 400px;
border-style: solid;
border-radius: 25px;
border-color: #2B5AA0;
}
</style>
</head>
<body class="d-flex flex-column h-100">
<header>
<nav class="navbar navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand"></a>
</div>
</nav>
</header>
<main class="flex-shrink-0">
<div class="container-xxl text-center">
<a href="/"><img class="my-2" id="MainImage" src="urlformjs.png" alt="URLFormJS"></a>
<form id="ExampleUserForm">
<div>
<input type="text" id="input_first_name" name="input_first_name" placeholder="First Name">
</div>
<div>
<input type="text" id="input_middle_name" name="input_middle_name" placeholder="Middle Name">
</div>
<div>
<input type="text" id="input_last_name" name="input_last_name" placeholder="Last Name">
</div>
<div>
<input type="text" id="input_email_address" name="input_email_address" placeholder="Email Address">
</div>
<div>
<input type="text" id="input_phone_number" name="input_phone_number" placeholder="Phone Number">
</div>
<div class="d-flex justify-content-center">
<div class="form-floating w-40">
<select title="Example country codes for (alphabetically) first,last, and United States." class="form-select" id="input_country_select" name="input_country_select">
<option disabled selected value> -- select a country -- </option>
<option value="1">United States</option>
<option value="93">Afghanistan</option>
<option value="263">Zimbabwe</option>
</select>
<label class="text-start" for="input_country_select">Country</label>
</div>
</div>
<!-- Bool Examples -->
<div>
<label for="input_subscribe">Subscribe</label>
<input type="checkbox" id="input_subscribe" name="input_subscribe">
</div>
<div>
<label for="input_default_check">Default Checked</label>
<input type="checkbox" id="input_default_check" name="input_default_check">
</div>
<div class="form-switch" title="">
<input class="form-check-input" type="checkbox" id="input_toggle" name="input_toggle">
<label class="text-start" for="input_toggle">Savable Toggle</label>
</div>
<div>
<label for="input_uri_settable">Only settable via URI</label>
<input type="checkbox" id="input_uri_settable" name="input_uri_settable" disabled>
</div>
<div>
<label for="customFunction">JS function triggered by URI flag:</label>
<span id="customFunction">false</span>
</div>
</form>
<button id="CustomShareURLBtnID" class="btn mt-3 btn-primary">🔗 Generate Share URL</button>
<p class="mt-1 mx-auto p-5" id="CustomShareURL"></p>
<button id="CustomClearBtnID" class="btn mt-3 btn-danger" title="This will clear the entire form and URL queries & fragments.">🗑️ Clear</button>
<div class="mt-5">
<!--
# Test URL
###Convention
Queries values are two letters,
Frag queries are one letter.
Extras begin with "e".
Extra before frag begin with "eb"
Extra after frag begin with "el"
Test one has:
- Query (first_name)
- Query Extra (eBob)
- Fragment Before (ebmarry)
- Fragment Queries (middle_name, last_name, email_address, phone_number, country_select, subscribe, uri_settable, customFunction)
- Fragment Query Extra (elmarry)
- Fragment after `:~:text=1354`
- Fragment Query starts and ends with a '&' to test so called "empty queries"
The resulting URL should be:
https://localhost:8082/demo_advanced.html?eBob=eBob#ebmarry=ebmarry?middle_name&last_name&email_address&phone_number&country_select&subscribe&uri_settable&customFunction&first_name&default_check&toggle&elmarry=elmarry:~:text=1354
-->
<p><a href="demo_advanced.html?first_name=ff&eBob=eBob#ebmarry=ebmarry?&middle_name=m&last_name=l&[email protected]&phone_number=p&country_select=1&subscribe&uri_settable&customFunction&elmarry=elmarry:~:text=1354">Advanced Test</a></p>
<p><a href="demo_advanced.html#?&subscribe&uri_settable&customFunction&uri_settable">Bool Test </a></p>
<p><a href=""></a></p>
<p><a href=""></a></p>
<p><a href=""></a></p>
<br>
<br>
<br>
<p><a href="demo_simple.html#?first_name=Bob&last_name=Smith&email_address=bob%40example.com&phone_number=1234567890&country_select=1&subscribe">Simple Demo </a></p>
</div>
</div><!-- end main container -->
</main>
<footer class="footer mt-auto py-3 bg-light text-center">
<h4><a href="https://github.com/Cyphrme/URLFormJS">Source code for URLFormJS</a></h4>
</footer>
</body>
</html>