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

hide and show content

Explorer ,
Apr 21, 2011 Apr 21, 2011

Copy link to clipboard

Copied

Hi,

I have the results page to display all records from the search and also I have the User Friendly Print button,  but content will hide or show depend on what action user clicked on.

For example:

<table name=”1”>

Display all results in the regular format

</table

<if isdefined(“print”)>

<table name=”2”>

Display all results in the print friendly format

</table

</cfif>

<input name=”print”>

<input name=”result”>

With this process, the code it worked well, but I don’t know how to hide the blog of table 1?

thanks

TOPICS
Advanced techniques

Views

748

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
Valorous Hero ,
Apr 21, 2011 Apr 21, 2011

Copy link to clipboard

Copied

In your simple code example, wrap the first table in a <cfif...> block that will be FALSE then the print control as been selected.

I.E.

<cfif isDefined("print") EQ false>

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
Explorer ,
Apr 21, 2011 Apr 21, 2011

Copy link to clipboard

Copied

I am not 100% sure in which you want to hide table. If you want to hide table in onClick of some html elements then you can use javascript to add style properties for table. Using javascript you can set display as none.

Please let me know if your requirement is different.

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
Participant ,
Apr 22, 2011 Apr 22, 2011

Copy link to clipboard

Copied

I use this lttle script...

<script language="javascript">
function togglemas() {
var ele = document.getElementById("togglemas");
var text = document.getElementById("displaymas");
if(ele.style.display == "block") {
      ele.style.display = "none";
  text.innerHTML = "Show Master Data";
   }
else {
  ele.style.display = "block";
  text.innerHTML = "Hide Master Data";
}
}
</script>

<a id="displaymas" href="javascript:togglemas();">Show Master Data</a>
<div id="togglemas" style="display: none">

Display Whatever...

</div>

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
Enthusiast ,
Apr 24, 2011 Apr 24, 2011

Copy link to clipboard

Copied

To be honest, separate _browser_ layouts for printing is pointless and So last decade.

I recommend using css to change the page appearance when printed. No new windows or refreshes needed.

http://www.w3.org/TR/CSS2/media.html

-Fernis

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
Participant ,
Apr 25, 2011 Apr 25, 2011

Copy link to clipboard

Copied

LATEST

use jquery hide(), show()...toggle

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