-<%
- my( $formname, $fields, $action, $url_or_message, $key ) = @_;
- $key = '' unless defined $key;
-
- my $url_or_message_link;
- if ( ref($url_or_message) ) { #its a message or something
- $url_or_message_link =
- 'message='. uri_escape( $url_or_message->{'message'} )
- } else {
- $url_or_message_link = "url=$url_or_message";
- }
-%>
+<%doc>
+Example:
+In misc/something.html:
+
+ <FORM NAME="MyForm">
+ <INPUT TYPE="hidden" NAME="recordnum" VALUE="42">
+ <INPUT TYPE="hidden" NAME="what_to_do" VALUE="delete">
+ <% include( '/elements/progress-init.html',
+ 'MyForm',
+ [ 'recordnum', 'what_to_do' ],
+ $p.'misc/process_something.html',
+ { url => $p.'where_to_go_next.html' },
+ #or { message => 'Finished!' },
+ #or { url => $p.'where_to_go.html',
+ message => 'Finished' },
+ # which displays the message, then waits for confirmation before
+ # redirecting to the URL.
+ #or { popup_url => $p.'popup_contents.html' }
+ # which loads that URL into the popup after completion
+ ) %>
+ </FORM>
+ <SCRIPT TYPE="text/javascript>process();</SCRIPT>
+
+In misc/process_something.html:
+
+<%init>
+my $server = FS::UI::Web::JSRPC->new('FS::something::process_whatever', $cgi);
+</%init>
+<% $server->process %>