2 Replies Latest reply on Jan 18, 2013 12:35 PM by elvideo123

    Hide datefield coldfusion control using JavaScript

    elvideo123

      I have a straight forward datefield control.  Looks like the following:

       

      <cfinput type="dateField" name="dt_RtDate" width="60px"  id="dt_RtDate" title="Enter or select repeat date" value=""  >

       

      Now I have a javascript function that happens on a click event that I use to want to hide this control it looks similar to the following:

       

      //Hide Repeater control

          var dtRepeater =  document.getElementById('dt_RtDate'); 

          dtRepeater.style.visibility = "hidden";

       

      this works fine, but there is a problem I notice.  The textbox dissapears and this is fine, but the calendar image control IS STILL VISIBLE?!

       

      So my question is I am not sure how to reference this control or property to make the entire thing go away.  I would also then like to know the flipside of showing it too (which I am using by saying ...  dtRepeater.style.visibility = "";   )

       

      So what do I have to do to reference the coldfusion date control to make it dissapear completely?

       

      Thanks,