3 <script src='../dist/jquery.js' type='text/javascript'></script>
19 <select class='select_test'>
20 <option value='one'>change me 1</option>
21 <option value='two'>change me 2</option>
22 <option value='three'>change me 3</option>
24 <select class='select_test'>
25 <option value='one'>change me 1</option>
26 <option value='two' selected="selected">change me 2</option>
27 <option value='three'>change me 3</option>
31 <select class='mselect_test' multiple="multiple">
32 <option value='one'>change me 1</option>
33 <option value='two'>change me 2</option>
34 <option value='three'>change me 3</option>
38 <input type="checkbox" class="checkbox_test" name="mycheckbox" id="checkbox1"/>
39 <label for="checkbox1">Checkbox 1</label><br/>
40 <input type="checkbox" class="checkbox_test" name="mycheckbox" id="checkbox2"/>
41 <label for="checkbox2">Checkbox 2</label>
42 <input type="checkbox" class="checkbox_test" name="mycheckbox" id="checkbox3" disabled="disabled"/>
43 <label for="checkbox3">Checkbox 3</label>
48 <input type="radio" class="radio_test" name="myradio" id="radio1"/>
49 <label for="radio1">Radio1</label><br/>
50 <input type="radio" class="radio_test" name="myradio" id="radio2"/>
51 <label for="radio2">Radio2</label>
52 <input type="radio" class="radio_test" name="myradio" id="radio3" disabled="disabled"/>
53 <label for="radio3">Radio3</label>
56 <input class="file_test" id="file1" type="file"/>
58 <input class='test' value='' id='input' size='10' />
59 <input class='test' value='test' id='input2' size='10' readonly="readonly" />
62 <textarea rows='2'></textarea>
64 <td>$(document).bind('change')</td>
68 <td id='select' class="red">SELECT</td>
69 <td id='mselect' class="red">MULTI</td>
70 <td id='checkbox' class="red">CHECKBOX</td>
71 <td id='radio' class="red">RADIO</td>
72 <td id='file' class="red">FILE</td>
73 <td id='text' class="red">TEXT</td>
74 <td id='textarea' class="red">TEXTAREA</td>
75 <td id='boundChange' class="red">DOCUMENT</td>
79 <td id='selectbind' class="red">SELECT</td>
80 <td id='mselectbind' class="red">MULTI</td>
81 <td id='checkboxbind' class="red">CHECKBOX</td>
82 <td id='radiobind' class="red">RADIO</td>
83 <td id='filebind' class="red">FILE</td>
84 <td id='textbind' class="red">TEXT</td>
85 <td id='textareabind' class="red">TEXTAREA</td>
89 <td id='selectfocus' class="red">SELECT</td>
90 <td id='mselectfocus' class="red">MULTI</td>
91 <td id='checkboxfocus' class="red">CHECKBOX</td>
92 <td id='radiofocus' class="red">RADIO</td>
93 <td id='filefocus' class="red">FILE</td>
94 <td id='textfocus' class="red">TEXT</td>
95 <td id='textareafocus' class="red">TEXTAREA</td>
96 <td id='boundFocus' class="red">DOCUMENT</td>
100 <td id='selectblur' class="red">SELECT</td>
101 <td id='mselectblur' class="red">MULTI</td>
102 <td id='checkboxblur' class="red">CHECKBOX</td>
103 <td id='radioblur' class="red">RADIO</td>
104 <td id='fileblur' class="red">FILE</td>
105 <td id='textblur' class="red">TEXT</td>
106 <td id='textareablur' class="red">TEXTAREA</td>
107 <td id='boundBlur' class="red">DOCUMENT</td>
111 <td id='selectlfocus' class="red">SELECT</td>
112 <td id='mselectlfocus' class="red">MULTI</td>
113 <td id='checkboxlfocus' class="red">CHECKBOX</td>
114 <td id='radiolfocus' class="red">RADIO</td>
115 <td id='filelfocus' class="red">FILE</td>
116 <td id='textlfocus' class="red">TEXT</td>
117 <td id='textarealfocus' class="red">TEXTAREA</td>
121 <td id='selectlblur' class="red">SELECT</td>
122 <td id='mselectlblur' class="red">MULTI</td>
123 <td id='checkboxlblur' class="red">CHECKBOX</td>
124 <td id='radiolblur' class="red">RADIO</td>
125 <td id='filelblur' class="red">FILE</td>
126 <td id='textlblur' class="red">TEXT</td>
127 <td id='textarealblur' class="red">TEXTAREA</td>
130 <h2>Submit Tests</h2>
137 <form action="" id="text_submit">
138 <input class='test' type='text' value='Key Return To Submit'/>
142 <form action="" id="password_submit">
143 <input class='test' type='password' value=''/>
147 <form action="" id="submit_submit">
148 <input type='submit' value="Click Me To Submit" />
151 <td>$(document).bind('submit')</td>
155 <td id='textSubmit' class="red">TEXT</td>
156 <td id='passwordSubmit' class="red">PASSWORD</td>
157 <td id='submitSubmit' class="red">BUTTON</td>
158 <td id='boundSubmit' class="red">DOCUMENT</td>
164 <script type='text/javascript'>
165 jQuery.fn.addChangeTest = function( id, prevent ) {
166 this.bind("focusin", function(){
167 jQuery(id + "focus").blink();
168 }).bind("focusout", function(){
169 jQuery(id + "blur").blink();
172 this.bind("focus", function(){
173 jQuery(id + "lfocus").blink();
174 }).bind("blur", function(){
175 jQuery(id + "lblur").blink();
178 return this.bind("change", function(e){
179 jQuery(id + "bind").blink();
180 }).live("change", function(e){
189 jQuery.fn.addSubmitTest = function( id, prevent ) {
190 return this.live("submit", function(e){
199 jQuery.fn.blink = function(){
200 return this.css("backgroundColor","green").css("border","solid 3px green").delay(700).queue(function(next){
201 jQuery(this).css("backgroundColor","");
206 $(document).bind("focusin", function() {
207 jQuery("#boundFocus").blink();
210 $(document).bind("focusout", function() {
211 jQuery("#boundBlur").blink();
214 $("td.red").live("hover", function(e) {
215 if ( e.type === "mouseenter" ) {
216 $(this).css("backgroundColor","green");
218 $(this).css("backgroundColor","");
222 $(".select_test").addChangeTest("#select");
223 $(".mselect_test").addChangeTest("#mselect");
224 $(".checkbox_test").addChangeTest("#checkbox");
225 $(".radio_test").addChangeTest("#radio");
226 $(".file_test").addChangeTest("#file");
227 $('textarea').addChangeTest("#textarea");
228 $('#input').addChangeTest("#text");
229 $(document).bind("change", function(){
230 jQuery("#boundChange").blink();
233 $("#text_submit").addSubmitTest("#textSubmit", true);
234 $("#password_submit").addSubmitTest("#passwordSubmit", true);
235 $("#submit_submit").addSubmitTest("#submitSubmit", true);
236 $(document).bind("submit", function(){
237 jQuery("#boundSubmit").blink();