Results 1 to 5 of 5

Thread: print and send button in one..

  1. #1
    Join Date
    May 2006
    Posts
    46
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default print and send button in one..

    Hey guys i have a credit form on my web site and i currently have 3 buttons reset-print-send..

    so whats happaning now is the the client only prints it and closes the window..so i never get it (stores in database)

    is it possible to make a submit button that would send the script but at the same time trigger a print cmd?

    in php

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Not that I have seen, but what you can do is make the send button say on it "print preview" or similar, and have the headers send it to another page that echos the same information but maybe without the graphics or something.

    That button before running headers, sends info to you. There is no print button on this page. Then you put the print button on the second page.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    May 2006
    Posts
    46
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    hmm true..

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Not saying your method can't be done, I just haven't seen it done, and a quick search turns up nada.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    It's not possible to do two things at once.

    There are two ways to make this work.

    1. Submit the page and on the loaded page trigger it to print (you can output a copy of the form). You can use Javascript to trigger it to print when the page loads.

    2. Use AJAX to dynamically submit the form (without reloading it). This is complex, but possible.


    REMEMBER-- both of these rely on Javascript and some users may not have it enabled. Therefore, it is a much better idea to use idea (1) because printing is not crucial and saving the data IS crucial.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •