-
Notifications
You must be signed in to change notification settings - Fork 3
/
demo.html
152 lines (139 loc) · 7.52 KB
/
demo.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
<html>
<head>
<script type="text/javascript" src="bower_components/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="src/jquery.otherdropdown.js"></script>
<script type="text/javascript">
$(function(){
// Binding the otherDropdowns listeners to our form
$('[name="Test-1"]').otherDropdown();
$('[name="Test-2"]').otherDropdown({value:'Something'});
$('[name="Test-3"]').otherDropdown({placeholder:'Type of event?'});
$('[name="Test-4"]').otherDropdown({classes:'lightgreen-bg'});
$('[name="Test-5"]').otherDropdown({classes:'lightgreen-bg', value:'Something', placeholder:'Type of event?' });
});
</script>
<style type="text/css">
.lightgreen-bg {
background-color: lightgreen !important;
}
</style>
</head>
<body style="display:none">
<title>jquery.otherdropdown v1.2.x</title>
<div class="container">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHPwYJKoZIhvcNAQcEoIIHMDCCBywCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAa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PxoRKSDaaBhQRwu2EShtLyC/llBuoxM2HG5dXzujD6ajybobuAFWSpG0xNduk6pnCd7laLhFPASlgoop1qhnjSeWvFBI6nTR0+GV5DG2EVnOzt6yZkB6GAYn0U=-----END PKCS7-----
">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
</form>
</div>
<xmp theme="united" style="display:none;">
# jquery.otherdropdown
A dropdown select box where choosing 'other' prompts the user for an alternate response.
![alt tag](https://raw.github.com/TheBox193/jquery.otherdropdown/master/screenshot.png)
* [Examples / Docs](http://otherdropdown.code.jstassen.com/)
* [Github](https://github.com/TheBox193/jquery.otherdropdown)
## Install
* Follow the instructions to install [Bower](http://bower.io/#install-bower).
* Switch to project folder and run `bower install jquery.otherdropdown --save`
* Include `jquery.otherdropdown.js` after jQuery is loaded in your document.
## Usage
* Bind jquery.otherdropdown to an html select, optionally pass an `options` object
* `$('select').otherdropdown()`
* `$('.mySelect').otherdropdown({placeholder:'Type your answer'})`
## Options
You can pass in options to otherdropdown as an object.
* `{value: 'more'}` - Optional, Value you wish to trigger the text input. `default = 'other'`
* `{classes: 'noborder greybg'}` - Optional, clases that the text input should have. `default = null`
* `{placeholder: 'Type your answer'}` - Optional, placeholder text on text input. `default = name`
## Future
* Add Callbacks hooks
* Create `min` builds
* Add tests
## Demos
</xmp>
<div class="container">
<form id="demo" name="demo" method="post" format="html">
<div class="row">
<p>
</p>
</div>
<div class="row">
<code>$('[name="Test-1"]').otherDropdown();</code>
</div>
<div class="row">
<select name="Test-1">
<option value="">Select One</option>
<option value="Birthday">Birthday</option>
<option value="Corporate Event">Corporate Event</option>
<option value="Other">Other</option>
</select>
</div>
<div class="row">
<code>$('[name="Test-2"]').otherDropdown({value:'Something'});</code>
</div>
<div class="row">
<select name="Test-2">
<option value="">Select One</option>
<option value="Birthday">Birthday</option>
<option value="Corporate Event">Corporate Event</option>
<option value="Something">Something Else</option>
</select>
</div>
<div class="row">
<code>$('[name="Test-3"]').otherDropdown({placeholder:'Type of event?'});</code>
</div>
<div class="row">
<select name="Test-3">
<option value="">Select One</option>
<option value="Birthday">Birthday</option>
<option value="Corporate Event">Corporate Event</option>
<option value="Other">Other</option>
</select>
</div>
<div class="row">
<code>$('[name="Test-4"]').otherDropdown({classes:'lightgreen-bg'});</code>
</div>
<div class="row">
<select name="Test-4">
<option value="">Select One</option>
<option value="Birthday">Birthday</option>
<option value="Corporate Event">Corporate Event</option>
<option value="Other">Other</option>
</select>
</div>
<div class="row">
<code>$('[name="Test-5"]').otherDropdown({classes:'lightgreen-bg', value:'Something', placeholder:'Type of event?' })</code>
</div>
<div class="row">
<select name="Test-5">
<option value="">Select One</option>
<option value="Birthday">Birthday</option>
<option value="Corporate Event">Corporate Event</option>
<option value="Something">Something</option>
</select>
</div>
<!-- <div class="row">
<input class="submit" type="submit" value="Submit">
</div> -->
<!-- <div class="row">
<pre>Array
(
)
</pre>
</div> -->
</form>
</div>
<script src="http://strapdownjs.com/v/0.2/strapdown.js"></script>
<script>
if( !localStorage.getItem('log') ) {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-20189868-4', 'auto');
ga('send', 'pageview');
}
</script>
</body></html>