| Author | 
         | 
         
      
        
         
         rudolf.riegler Newbie 
          
 
  Joined: 12 November 2012
 Online Status: Offline Posts: 18
          | 
        
         
          
           | Posted: 24 November 2012 at 9:36am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Hy,
 
 for my web-application I have to disable (set read only) some fields in the Edit-Contact form, e.g. fields in the groups Home, Business and Other.
 
 Is it possible and how to do this??? Thanks in advance for a reply.
 
 best regards
 Rudi
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Igor AfterLogic Support 
          
 
  Joined: 24 June 2008 Location: United States
 Online Status: Offline Posts: 6168
          | 
        
         
          
           | Posted: 26 November 2012 at 3:58am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Are you speaking of ASP.NET or PHP version of WebMail Lite?
 
 --
 Regards,
 Igor, AfterLogic Support
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         rudolf.riegler Newbie 
          
 
  Joined: 12 November 2012
 Online Status: Offline Posts: 18
          | 
        
         
          
           | Posted: 26 November 2012 at 8:05am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
 
Igor wrote: 
   
    
    
      
       Are you speaking of ASP.NET or PHP version of WebMail Lite?
  | 
       
       | 
    
    | 
 
  
 
 Ohhh...sorry...ASP.Net!!!!
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Igor AfterLogic Support 
          
 
  Joined: 24 June 2008 Location: United States
 Online Status: Offline Posts: 6168
          | 
        
         
          
           | Posted: 26 November 2012 at 8:55pm | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
There might be several ways to achieve that. The most straightforward one is as follows. Locate the file js\contacts\edit-contact.js, it's where those fields are created. 
 
 Let's assume you need to lock Business Email field. Locate the code where it's created:
 
 
Code: 
   
    
    
      
                 td.innerHTML = Lang.BusinessEmail + ':';
           WebMail.LangChanger.Register('innerHTML', td, 'BusinessEmail', ':'); | 
       
       | 
    
    | 
 
 
 
 A few lines after that, input element is created:
 
 
Code: 
   
    
    
      
       |           inp = CreateChild(td, 'input', [['type', 'text'], ['class', 'wm_input'], ['size', '45'], ['maxlength', '255']]); | 
       
       | 
    
    | 
 
 
 
 As you can see, several attributes are assigned there. Add readonly attribute to them:
 
 
Code: 
   
    
    
      
       |           inp = CreateChild(td, 'input', [['type', 'text'], ['class', 'wm_input'], ['readonly', 'readonly'], ['size', '45'], ['maxlength', '255']]); | 
       
       | 
    
    | 
 
 
 
 You'll probably need to purge browser cache to make sure changes in the code are applied.
 
 Hope this helps!
 
 --
 Regards,
 Igor, AfterLogic Support
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   |