File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,18 @@ $(function(){
3030
3131
3232 function disable_rugosity_meter_marks ( ) {
33-
34- var $rugIndexGreater = $ ( '#benthic_cover_rugosity_measure_attributes_rug_meters_completed' ) . val ( ) - 1 ;
3533 var $rugIndexLess = $ ( '#benthic_cover_rugosity_measure_attributes_rug_meters_completed' ) . val ( ) ;
36-
37-
38- $ ( ".RugosityCat:lt(" + $rugIndexLess + ")" ) . attr ( "disabled" , false ) ;
39- $ ( ".RugosityCat:gt(" + $rugIndexGreater + ")" ) . val ( "" ) . attr ( "disabled" , true ) ;
40-
34+
35+ $ ( '.RugosityCat' ) . each ( function ( index , el ) {
36+
37+ var value = index + 1 ;
38+
39+ if ( value > parseInt ( $rugIndexLess ) ) {
40+ $ ( el ) . val ( "" ) . removeClass ( "error" ) . attr ( "disabled" , true ) ;
41+ $ ( el ) . siblings ( "span" ) . remove ( ) ;
42+ } else { $ ( el ) . attr ( "disabled" , false ) ; }
43+ }
44+ ) ;
4145 } ;
4246
4347 disable_rugosity_meter_marks ( ) ;
You can’t perform that action at this time.
0 commit comments