-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
64 lines (57 loc) · 2.65 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Demo for Key-Value Json Input jQuery Plugin</title>
<link rel="stylesheet" href="http://twitter.github.io/bootstrap/assets/css/bootstrap.css">
<link rel="stylesheet" href="http://twitter.github.io/bootstrap/assets/js/google-code-prettify/prettify.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script src="//twitter.github.io/bootstrap/assets/js/google-code-prettify/prettify.js" type="text/javascript"></script>
<script type="text/javascript" src="jquery.kv-json-input.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="span12">
<form id="custom-server-form" action="" method="POST">
<legend>Demo for Key-Value Json Input jQuery Plugin</legend>
<input type="input" name="serverConfig" id="server-config-data" value="{"domain":"www.lovelucy.info"}" />
<div class="form-actions">
<button type="submit" class="btn" id="save">Submit</button>
</div>
</form>
</div>
</div>
<div class="row">
<div class="span12">
<strong>Code</strong>
<pre class="prettyprint lang-html linenums">
<form id="custom-server-form" action="" method="POST">
<legend>Demo for Key-Value Json Input jQuery Plugin</legend>
<input type="input" name="serverConfig" id="server-config-data"
value="{&quot;domain&quot;:&quot;www.lovelucy.info&quot;}" />
<div class="form-actions">
<button type="submit" class="btn" id="save">Submit</button>
</div>
</form>
<script>
$(function() {
$('#server-config-data').kvJsonInput();
});
</script>
</pre>
</div>
</div>
</div>
<script>
$(function() {
window.prettyPrint && prettyPrint();
$('#server-config-data').kvJsonInput();
$('#custom-server-form').submit(function(e){
alert($('input[name="serverConfig"]').val());
return true;
});
});
</script>
</body>
</html>