I need to implement a function about: when current user is not active, all the content should be disabled.
With jQuery, it's pretty easy ,
- var active = "${active}";
- if(active =='false' ){
- $(".form-input :input").each( function(i) {
- $(this).attr('disabled', 'disabled');
- });
comments:
line 1: get the user's active status
line 2: if user is not active
line 3: loop to get all the input elements(like text, checkbox, radio
line 4: disable all the input if the user is not active
Comments
Post a Comment