I'm trying to open a new window for printing a form from a link. I want
to display the contents of the form for printing. I can get the popup
to work, but am wondering how to get the contents of the form from the
parent window, using RJS.
I can use a submit option to get the form parameters in a
link_to_remote, but the popup doesn't work.
I'm trying to open a new window for printing a form from a link. I want
to display the contents of the form for printing. I can get the popup
to work, but am wondering how to get the contents of the form from the
parent window, using RJS.
I can use a submit option to get the form parameters in a
link_to_remote, but the popup doesn't work.
1. Remove the :popup option and have your print action save your
form params in the session and do a RJS "window.open" to a second
action that generates the print HTML using these session params.
2. Make the Print link a link_to_function that adds the form parms
to a print URL on which window.open is called. Hide the address
bar to hide the ugly URL.
3. POST the form using a normal HTML form with target set to "_blank"
and with a "Print" submit button (or onclick form.submit() link).
If you have another submit button you can script a button-dependent
setting of the form's target parameter.