Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138163

JS: Submit or transfer input values to another HTML File?

$
0
0

Description:

I created this workflow: PHP loads content from a database to certain textareas. The user can edit and save content.

I created a HTML template which can be printed directly from the web browser.

So the user clicks on the "Print" button and gets a nice template which can be printed directly from the browser.

Goal:

I want jQuery or JavaScript to load / transfer the content from the input fields to another HTML document on the server, in certain div-classes.

Is this generally possible or a good idea?

Afterwards, this becomes loaded and the print dialogue of the web browser will be opened.

Present Code:

$(document).ready(function() {
    $( ".print-button" ).click(function() {
      $('html').load("./views/print/template-1.html");
      setTimeout(function(){
        window.print(); 
      }, 1000);
    })

    window.onafterprint = function(e){
        $(window).off('mousemove', window.onafterprint);
        window.location.href = window.location.href;
    };

});    

So template-1.html should get the data.


Viewing all articles
Browse latest Browse all 138163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>