locked
CRM 4.0 disabling datafield with javascript RRS feed

  • Question

  •  

    Hi,

     

    I want to disable some datefields on the onload event depending on the values in some other fields.So i have to disable the datefields with javascript instead of the normal field disable function.

     

    i am using the following code:

      crmForm.all.cit_lastupdate1img.disabled = true;
      crmForm.all.cit_lastupdate1img.src = '/_imgs/btn_dis_cal.gif';

     

    This works fine and disables the datepicker image. But i am missing 2 things here.

     

    1) It is still possible to put in a date by tying it manually. How do i prevent this?

    2) How do i change the background and bordercoler of the field?(Not the image). I have tryied the following but it doesnt work.
      style.borderColor = "#c5c5c5";
      style.backgroundColor = "#eaf3ff";

     

     

    regards

    Ben

    Thursday, March 27, 2008 9:36 AM

All replies