fix safari weirdness with caching iframes and auto-submitting them (in tax editor...
[freeside.git] / httemplate / elements / popup_link.html
1 <%doc>
2
3 Example:
4
5   <SCRIPT TYPE="text/javascript" SRC="overlibmws.js"></SCRIPT>
6   <SCRIPT TYPE="text/javascript" SRC="iframecontentmws.js"></SCRIPT>
7
8   include( '/elements/popup_link.html', { #hashref or a list, either way is fine
9
10     #required
11     'action'         => 'content.html', # uri for content of popup
12     'label'          => 'click me',     # text of <A> tag
13    
14     #strongly recommended
15     'actionlabel     => 'You clicked',  # popup title
16    
17     #opt
18     'width'          => '540',
19     'color'          => '#ff0000',
20     'closetext'      => 'Go Away',      # the value '' removes the link
21   } )
22
23 </%doc>
24 % if ($params->{'action'} && $label) {
25 <A HREF="javascript:void(0);" onClick="<% $onclick %>"><% $label %></A>\
26 % }
27 <%init>
28
29 my $params;
30 if (ref($_[0]) eq 'HASH') {
31   #$params = { %$params, %{ $_[0] } };
32   $params = shift;
33 } else {
34   #$params = { %$params, @_ };
35   $params = { @_ };
36 }
37
38 my $label = $params->{'label'};
39 my $onclick = include('/elements/popup_link_onclick.html', $params);
40
41 </%init>