3 <script src='../dist/jquery.js' type='text/javascript'></script>
\r
6 background-color: red;
\r
7 border: solid 3px red;
\r
12 <h2>Change Tests</h2>
\r
19 <select class='select_test'>
\r
20 <option value='one'>change me 1</option>
\r
21 <option value='two'>change me 2</option>
\r
22 <option value='three'>change me 3</option>
\r
26 <select class='mselect_test' multiple="multiple">
\r
27 <option value='one'>change me 1</option>
\r
28 <option value='two'>change me 2</option>
\r
29 <option value='three'>change me 3</option>
\r
33 <input type="checkbox" class="checkbox_test" name="mycheckbox" id="checkbox1"/>
\r
34 <label for="checkbox1">Checkbox 1</label><br/>
\r
35 <input type="checkbox" class="checkbox_test" name="mycheckbox" id="checkbox2"/>
\r
36 <label for="checkbox2">Checkbox 2</label>
\r
37 <input type="checkbox" class="checkbox_test" name="mycheckbox" id="checkbox3" disabled="disabled"/>
\r
38 <label for="checkbox3">Checkbox 3</label>
\r
43 <input type="radio" class="radio_test" name="myradio" id="radio1"/>
\r
44 <label for="radio1">Radio1</label><br/>
\r
45 <input type="radio" class="radio_test" name="myradio" id="radio2"/>
\r
46 <label for="radio2">Radio2</label>
\r
47 <input type="radio" class="radio_test" name="myradio" id="radio3" disabled="disabled"/>
\r
48 <label for="radio3">Radio3</label>
\r
51 <input class='test' value='' id='input' size='10' />
\r
52 <input class='test' value='test' id='input2' size='10' readonly="readonly" />
\r
55 <textarea rows='2'></textarea>
\r
57 <td>$(document).bind('change')</td>
\r
61 <td id='select' class="red">SELECT</td>
\r
62 <td id='mselect' class="red">MULTI</td>
\r
63 <td id='checkbox' class="red">CHECKBOX</td>
\r
64 <td id='radio' class="red">RADIO</td>
\r
65 <td id='text' class="red">TEXT</td>
\r
66 <td id='textarea' class="red">TEXTAREA</td>
\r
67 <td id='boundChange' class="red">DOCUMENT</td>
\r
71 <td id='selectbind' class="red">SELECT</td>
\r
72 <td id='mselectbind' class="red">MULTI</td>
\r
73 <td id='checkboxbind' class="red">CHECKBOX</td>
\r
74 <td id='radiobind' class="red">RADIO</td>
\r
75 <td id='textbind' class="red">TEXT</td>
\r
76 <td id='textareabind' class="red">TEXTAREA</td>
\r
80 <td id='selectfocus' class="red">SELECT</td>
\r
81 <td id='mselectfocus' class="red">MULTI</td>
\r
82 <td id='checkboxfocus' class="red">CHECKBOX</td>
\r
83 <td id='radiofocus' class="red">RADIO</td>
\r
84 <td id='textfocus' class="red">TEXT</td>
\r
85 <td id='textareafocus' class="red">TEXTAREA</td>
\r
89 <td id='selectblur' class="red">SELECT</td>
\r
90 <td id='mselectblur' class="red">MULTI</td>
\r
91 <td id='checkboxblur' class="red">CHECKBOX</td>
\r
92 <td id='radioblur' class="red">RADIO</td>
\r
93 <td id='textblur' class="red">TEXT</td>
\r
94 <td id='textareablur' class="red">TEXTAREA</td>
\r
97 <h2>Submit Tests</h2>
\r
104 <form action="" id="text_submit">
\r
105 <input class='test' type='text' value='Key Return To Submit'/>
\r
109 <form action="" id="password_submit">
\r
110 <input class='test' type='password' value=''/>
\r
114 <form action="" id="submit_submit">
\r
115 <input type='submit' value="Click Me To Submit" />
\r
118 <td>$(document).bind('submit')</td>
\r
122 <td id='textSubmit' class="red">TEXT</td>
\r
123 <td id='passwordSubmit' class="red">PASSWORD</td>
\r
124 <td id='submitSubmit' class="red">BUTTON</td>
\r
125 <td id='boundSubmit' class="red">DOCUMENT</td>
\r
131 <script type='text/javascript'>
\r
132 jQuery.fn.addChangeTest = function( id, prevent ) {
\r
133 this.bind("focusin", function(){
\r
134 jQuery(id + "focus").blink();
\r
135 }).bind("focusout", function(){
\r
136 jQuery(id + "blur").blink();
\r
139 return this.bind("change", function(e){
\r
140 jQuery(id + "bind").blink();
\r
141 }).live("change", function(e){
\r
143 e.preventDefault();
\r
146 jQuery(id).blink();
\r
150 jQuery.fn.addSubmitTest = function( id, prevent ) {
\r
151 return this.live("submit", function(e){
\r
153 e.preventDefault();
\r
156 jQuery(id).blink();
\r
160 jQuery.fn.blink = function(){
\r
161 return this.css("backgroundColor","green").css("border","solid 3px green").delay(700).queue(function(next){
\r
162 jQuery(this).css("backgroundColor","");
\r
167 $(".select_test").addChangeTest("#select");
\r
168 $(".mselect_test").addChangeTest("#mselect");
\r
169 $(".checkbox_test").addChangeTest("#checkbox");
\r
170 $(".radio_test").addChangeTest("#radio");
\r
171 $('textarea').addChangeTest("#textarea");
\r
172 $('#input').addChangeTest("#text");
\r
173 $(document).bind("change", function(){
\r
174 jQuery("#boundChange").blink();
\r
177 $("#text_submit").addSubmitTest("#textSubmit", true);
\r
178 $("#password_submit").addSubmitTest("#passwordSubmit", true);
\r
179 $("#submit_submit").addSubmitTest("#submitSubmit", true);
\r
180 $(document).bind("submit", function(){
\r
181 jQuery("#boundSubmit").blink();
\r