Forum Moderators: open

Message Too Old, No Replies

Display Form Results In New Window

Want to display form results in a new window

         

Elekar

7:27 pm on Mar 4, 2009 (gmt 0)

10+ Year Member



I'm looking for the code to put in my form to have the results display in a new window and also have a print command available. I've been searching for just HTML code, but I'm not finding anything. Since I'm brand new to this, I'm not sure if I'm asking the right question. Can anyone offer any help?

Thanks!

tedster

8:18 pm on Mar 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello Elekar, and welcome to the forums

It's a response to the form processing, so it's going to depend on the scripting language you use on the server. It's not an html thing.

Elekar

8:39 pm on Mar 4, 2009 (gmt 0)

10+ Year Member



Thanks, Tedster. I'm using GoDaddy as my server, and they use PHP in order to process forms. Do you happen to know if a javascript might work? At the very least, I would like to post the form results on a web page, new window or not. Any ideas?

tedster

12:30 am on Mar 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A form processing script can open the results in a new window. Whether this is within possibility for your particular hosting situation is something only your web host can answer.

We've got a PHP Forum [webmasterworld.com] on WebmasterWorld. If you try PHP and run into a snag coding the form script, that's the place to ask.

Yes, Javascript can process forms - although that's far from a best practice in most cases. If you find you must go the Javascript route and you run into troubles, try our Javascript forum [webmasterworld.com].

rocknbil

4:04 pm on Mar 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This very question was asked and answered just a few days ago in the Javascript forum [webmasterworld.com].

You should always make a print command the user's choice with

<a href="#" onClick="window.print(); return false;">Print</a>

But the window.print() can be loaded with window.onload();

<script type="text/javascript">
window.onload=function() { window.print(); }
</script>