Skip to main content
Known Participant
February 23, 2010
Question

how to pass link in this code

  • February 23, 2010
  • 1 reply
  • 343 views

Hi sorry for posting this in wrong forum but i am new to coldfusion so i might get some help in this forum

here is small code

script type="text/javascript" language="JavaScript">
   
       function ShowContent(d,e) {
       document.getElementById(d).style.display = "block";
       document.getElementById(e).style.display = "none";
       }
</script>
<div align="center">   
       <a href="javascript:ShowContent('comp_run','add_job')">Schedule Comp Job</a> |
       <a href="javascript:ShowContent('add_job','comp_run')">Add Job to Daily Run</a>
</div>
<br />

we need to pass link to this but i am not able to know how to pass link for both of these links below,

Any idea in this might help me

Thanks.

This topic has been closed for replies.

1 reply

Participating Frequently
February 23, 2010

Not sure what you mean by "pass link".  Looks like you are trying to toggle divs.  This is how I do it:

// a Function for hiding a div

function hidediv(div)
{
  document.getElementById(div).style.display='none';
}
 
//a function for showing a div, for ease just hide all, then just show the one you want to show

function showdiv(div)
{
  hidediv('aboutus');hidediv('services');hidediv('other1');hidediv('other2');hidediv('contactus');
  document.getElementById(div).style.display='block';
}