write 2 selecter in one wraped set jquery

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oranoos3000
    New Member
    • Jan 2009
    • 107

    #1

    write 2 selecter in one wraped set jquery

    hi

    i write below code for filter textfield and textarea in part of my form , that code is as follow as
    Code:
    (function($){
      $.fn.setReadOnly = function(readonly, opacityRo, opacityNRo) {
        if(!opacityNRo) {
                opacityNRo = 1; 
        }
        if(!opacityRo) {
                opacityRo = 0.5; 
        }
        
        if(opacityRo<=100 && opacityRo>1) {opacityRo /= 100;}
        if(opacityNRo<=100 && opacityNRo>1) {opacityNRo /= 100;}
     
       return this.filter('input:text').add('textarea')
          .attr('readonly',readonly)
          .css('opacity', readonly ? opacityRo : opacityNRo);
      } 
    })(jQuery);
    in this code i filter wraped set to textfield and add textarea how i can make list of textfield and textarea without need to add textarea later . my meaning is that writing textfield and textarea together in filter method

    thanks alot for your help.
  • oranoos3000
    New Member
    • Jan 2009
    • 107

    #2
    i'm sorry
    i forget to say i using jquery

    Comment

    Working...