Hide Date Field Date Picker Icon

Sort:
You are not authorized to post a reply.
Author
Messages
Kevin Cubillas
Basic Member
Posts: 9
Basic Member
    Hi,

    I am working on a DS form that has fields I want to hide and display as a user fills out other fields.  When I try to hide a date field, the little date picker icon () does not disappear.  The date field disappears but the icon does not.  Also, if I place another field on top of it and make it visible, the date picker continues to display through the visible field. 

    Code to make date field hidden:
    var objDate1 = lawForm.UIDocument.getElementById("_f22");
    objDate1.style.visibility = "hidden";

    Any ideas???

    Phil Romov
    Veteran Member
    Posts: 44
    Veteran Member
      Not that this would be portable, or officially supported, or anything, but you could use something like jquery (something like <script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script> either in your source or in your default.html for the portal role, if the source doesn't work) and then use dom traversal to find the date picker element, something like http://api.jquery.com/next/ maybe <br /> <br /> Even easier would probably be to inspect the lawson generated html and manipulate that <br />
      Phil Romov
      Veteran Member
      Posts: 44
      Veteran Member
        Even easier, I pulled up AP20 in MSIE, went to developer tools, searched for ico_form_calendar (that's the filename of the little date picker icon) and found the id (analogous to _f22) to be SELBUTTON_f15

        You can use the same technique to find your date picker. In fact, I bet for your case, you could just add this code:


        var objDate1_picker = lawForm.UIDocument.getElementById("SELBUTTON_f22");
        objDate1_picker.style.visibility = "hidden";
        Kevin Cubillas
        Basic Member
        Posts: 9
        Basic Member
          Thanks Phil! That worked. I need to get my arms around the ability to mine objects in a rendered form in IE. That's very good skill to have.
          Phil Romov
          Veteran Member
          Posts: 44
          Veteran Member
            Developer tools (F12) makes it easy.

            Glad you got it sorted
            You are not authorized to post a reply.