locked
CRM 4.0 Disable field/s based upon drop down selection RRS feed

  • Question

  • I'm not looking for field level security, I'm looking to change teh way a page looks based upon a drop down selection.  I might be going about this wrong too.

    Q: I want to disable or hide irrelevant fields based upon a drop down on  a Case.  I want to eliminate user confusion of when do I complete this field when don't I? Conditional HTML essentially.

    Notes: Changing which fields would be required would be handy but not a deal breaker.

    Thanks,
    Withers


    Tuesday, January 6, 2009 6:07 PM

Answers

  • on client side on change of the drop down field you can disable/hide other fields

    e.g.

     

    if(crmForm.all.casetypecode.DataValue == 2)
    {
        crmForm.all.caseorigincode.disabled = true; // to disable

     

        // to hide
        crmForm.all.customersatisfactioncode.style.display = "none";
        crmForm.all.customersatisfactioncode_c.style.display = "none"; // for label
    }

     

    Similarly you can set the required level also.

     

    Wednesday, January 7, 2009 5:25 AM
  • to change the label

        crmForm.all.customersatisfactioncode_c.innerText = "Label";

    to have it onload as well, create a variable as function on the onload event and call from the onchange and onload event - handleOnChange();

     

    handleOnChange = function()
    {
       if(crmForm.all.casetypecode.DataValue == 2)
       {
         crmForm.all.caseorigincode.disabled = true;
         crmForm.all.customersatisfactioncode.style.display = "none";
         crmForm.all.customersatisfactioncode_c.innerText = "Label";
       }
    }
    Wednesday, January 7, 2009 6:48 PM

All replies

  • on client side on change of the drop down field you can disable/hide other fields

    e.g.

     

    if(crmForm.all.casetypecode.DataValue == 2)
    {
        crmForm.all.caseorigincode.disabled = true; // to disable

     

        // to hide
        crmForm.all.customersatisfactioncode.style.display = "none";
        crmForm.all.customersatisfactioncode_c.style.display = "none"; // for label
    }

     

    Similarly you can set the required level also.

    Wednesday, January 7, 2009 5:25 AM
  • on client side on change of the drop down field you can disable/hide other fields

    e.g.

     

    if(crmForm.all.casetypecode.DataValue == 2)
    {
        crmForm.all.caseorigincode.disabled = true; // to disable

     

        // to hide
        crmForm.all.customersatisfactioncode.style.display = "none";
        crmForm.all.customersatisfactioncode_c.style.display = "none"; // for label
    }

     

    Similarly you can set the required level also.

     

    Wednesday, January 7, 2009 5:25 AM
  • On that same note how do you change the label of a field using the OnChange?
    crmForm.all.fieldid.title = "value"  only seems to change the tooltip.

    Lastly, since this is an on change event how do i get the form to load with the same change?  Do I have to copy the code to both places?  ?FireOnChange?

    I'm looking for dynamic forms based upon new and existing data.
    Wednesday, January 7, 2009 5:41 PM
  • to change the label

        crmForm.all.customersatisfactioncode_c.innerText = "Label";

    to have it onload as well, create a variable as function on the onload event and call from the onchange and onload event - handleOnChange();

     

    handleOnChange = function()
    {
       if(crmForm.all.casetypecode.DataValue == 2)
       {
         crmForm.all.caseorigincode.disabled = true;
         crmForm.all.customersatisfactioncode.style.display = "none";
         crmForm.all.customersatisfactioncode_c.innerText = "Label";
       }
    }
    Wednesday, January 7, 2009 6:48 PM
  • In customersatisfactioncode_c, why is "_c" being used? does it mean caption?
    Sohaib Ahmad [Business Management Solution Professional] http://www.solutiontalk.blogspot.com
    Tuesday, August 4, 2009 9:06 AM