File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 11/*!
22 * jQuery Form Plugin
3- * version: 3.04 (03 -APR-2012)
3+ * version: 3.05 (06 -APR-2012)
44 * @requires jQuery v1.3.2 or later
55 *
66 * Examples and documentation at: http://malsup.com/jquery/form/
@@ -978,7 +978,7 @@ $.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
978978 var re = / ^ (?: c o l o r | d a t e | d a t e t i m e | e m a i l | m o n t h | n u m b e r | p a s s w o r d | r a n g e | s e a r c h | t e l | t e x t | t i m e | u r l | w e e k ) $ / i; // 'hidden' is not in this list
979979 return this . each ( function ( ) {
980980 var t = this . type , tag = this . tagName . toLowerCase ( ) ;
981- if ( re . test ( t ) || tag == 'textarea' || ( includeHidden && / h i d d e n / . test ( t ) ) ) {
981+ if ( re . test ( t ) || tag == 'textarea' ) {
982982 this . value = '' ;
983983 }
984984 else if ( t == 'checkbox' || t == 'radio' ) {
@@ -987,6 +987,15 @@ $.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
987987 else if ( tag == 'select' ) {
988988 this . selectedIndex = - 1 ;
989989 }
990+ else if ( includeHidden ) {
991+ // includeHidden can be the valud true, or it can be a selector string
992+ // indicating a special test; for example:
993+ // $('#myForm').clearForm('.special:hidden')
994+ // the above would clean hidden inputs that have the class of 'special'
995+ if ( ( includeHidden === true && / h i d d e n / . test ( t ) ) ||
996+ ( typeof includeHidden == 'string' && $ ( this ) . is ( includeHidden ) ) )
997+ this . value = '' ;
998+ }
990999 } ) ;
9911000} ;
9921001
You can’t perform that action at this time.
0 commit comments