locked
Choosing "Other" leads to text box RRS feed

  • Question

  • Hi all,

     

    Probabaly a really simple thing to do but i am still getting to grips with dynamics. I have an options set, i want one of the options to be Other and upon clicking this a text box is available for the user to input text into. Any ideas!?

    Monday, August 15, 2011 3:42 PM

Answers

  • Hi. That functionality is often used and although there is no OOB solution that will take care of it, it is easy to implement:

    You can customize your option set to contain a new option "Other" (settings --> Customization --> Customize the system ...)

    Then you can create a text field for entering the reason when "Other is selected" and place the field next to your option set, hide it by default.

    Now you just need a JavaScript (WebResource) that will show/hide the text field depending on whether "Other" is selected or not. You could even make the text field required if the "Other" option has been selected.


    Gonzalo | gonzaloruizcrm.blogspot.com

    Monday, August 15, 2011 3:52 PM
    Moderator
  • Hi,

    Following steps:

    1. Create new OptionSet value "Other"

    2. Create new Text field Other

    3. Add the following code on OnChange Event of OptionSet field:

     

    var jj_PickListField = Xrm.Page.data.entity.attributes.get("jj_PickListItem");
    

     

    var jj_OtherField = Xrm.Page.ui.controls.get("jj_Other_Field");


    if (jj_PickListField.getText() != null && jj_PickListField.getText() == "Other")
    {
        jj_OtherField.setVisible(true);
    }
    else
    {
        jj_OtherField.setVisible(false);
    }


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

    Monday, August 15, 2011 3:57 PM

All replies

  • Hi. That functionality is often used and although there is no OOB solution that will take care of it, it is easy to implement:

    You can customize your option set to contain a new option "Other" (settings --> Customization --> Customize the system ...)

    Then you can create a text field for entering the reason when "Other is selected" and place the field next to your option set, hide it by default.

    Now you just need a JavaScript (WebResource) that will show/hide the text field depending on whether "Other" is selected or not. You could even make the text field required if the "Other" option has been selected.


    Gonzalo | gonzaloruizcrm.blogspot.com

    Monday, August 15, 2011 3:52 PM
    Moderator
  • Hi,

    Following steps:

    1. Create new OptionSet value "Other"

    2. Create new Text field Other

    3. Add the following code on OnChange Event of OptionSet field:

     

    var jj_PickListField = Xrm.Page.data.entity.attributes.get("jj_PickListItem");
    

     

    var jj_OtherField = Xrm.Page.ui.controls.get("jj_Other_Field");


    if (jj_PickListField.getText() != null && jj_PickListField.getText() == "Other")
    {
        jj_OtherField.setVisible(true);
    }
    else
    {
        jj_OtherField.setVisible(false);
    }


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

    Monday, August 15, 2011 3:57 PM