Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8154261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:17:00+00:00 2026-06-06T16:17:00+00:00

I am using AJAX to send form data to a server php file that

  • 0

I am using AJAX to send form data to a server php file that builds and sends an html email. A portion of this data I am echoing on the server php file. The html that is echoed builds a table that I would like the user to print (on paper). I’d like to open the default browser print dialog so the user can print the table that he/she cannot see. I don’t care if a new tab has to open displaying the echoed content. Is this even possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T16:17:02+00:00Added an answer on June 6, 2026 at 4:17 pm

    return that html form ajax request and then use javascript to print

    This code is not tested

    JQuery/Javascript

    $.post("EmailFile.php", { "EmailParam": "EmailVal" },
         function(data){
             var HTML = data.EmailHTML;
    
            var WindowObject = window.open("", "PrintWindow", "width=750,height=650,top=50,left=50,toolbars=no,scrollbars=yes,status=no,resizable=yes");
            WindowObject.document.writeln(HTML);
            WindowObject.document.close();
            WindowObject.focus();
            WindowObject.print();
            WindowObject.close();
    
         }, "json");
    

    PHP File (EmailFile.php)

    $EmailData = $_POST['EmailParam'];
    //...Send Email...
    
    //..Build HTML...
    $TableHTML = "<table></table>";
    
    //Return HTML
    $JSONArr['EmailHTML'] = $TableHTML;
    echo json_encode($JSONArr);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to send looping data from html page to php page using ajax. I
I am using the ajax() function to send a string to a PHP file.
I'm trying to send back multiple variables from a php file to ajax using
I've made a login that uses ajax to send the form to a php
i am trying to send multiple data using j query $.ajax method to my
I'm using ajax requests to populate modal popup windows with data that users have
I am using Ajax to retrieve the data from server as below based on
I am using Ajax POST method to send data, but i am not able
Imagine this simple form for uploading a file: <form action=upload enctype=multipart/form-data> <input type=text name=name/>
Using ajax+php in my signup form. There are 2 validations: JS side frontend and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.