?
Solved

How can I use html:link to run only a JavaScript function?

Posted on 2009-02-18
2
Medium Priority
?
205 Views
Last Modified: 2012-05-06
I am trying to hide a div "chunk" using an html-el:link tag but its not working.  I'm setting the page attribute equal to the page in which the div is located.  I'm just getting a "page not found" error.  Can someone tell me how to hide the div section using the link without getting the error page?

Thanks to all of you good souls!
function hideCriteriaSubTotals() {
	alert("Point1");
	document.getElementById("criteriaSubtotals").style.display="none";
	
	alert("Point2");
}
 
<html-el:link page="/jsp/pendingTotalsReport.jsp" onclick="hideCriteriaSubTotals();" >
       Hide Criteria Subtotals
</html-el:link>
 
<div id="criteriaSubtotals">		
       CriteriaSubtotal goes here.			
</div>

Open in new window

0
Comment
Question by:jwright9
2 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 2000 total points
ID: 23679361
Have you tried

page="#"

Or even plain HTML (I know that is very hard)

<a href="#" onclick="hideCriteriaSubTotals();">
0
 

Author Comment

by:jwright9
ID: 23684375
Thanks!  I found that
<html-el:link href="javascript:hideCriteriaSubTotals();">
   Hide Criteria Subtotals
</html-el:link>

Works.
Thanks for the alternative answer sybe!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question