• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Hide datefield coldfusion control using JavaScript

New Here ,
Jan 18, 2013 Jan 18, 2013

Copy link to clipboard

Copied

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,

Views

558

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 18, 2013 Jan 18, 2013

Copy link to clipboard

Copied

You could always put it inside a span or div and do your show/hide on that element.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 18, 2013 Jan 18, 2013

Copy link to clipboard

Copied

LATEST

yup that makes sense did that instead thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation